mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add client
relationship to CreditTransformer
This commit is contained in:
parent
e4ba8e16a7
commit
ff1acba00c
@ -18,6 +18,7 @@ use App\Models\CreditInvitation;
|
|||||||
use App\Models\Document;
|
use App\Models\Document;
|
||||||
use App\Transformers\ActivityTransformer;
|
use App\Transformers\ActivityTransformer;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use League\Fractal\Resource\Item;
|
||||||
|
|
||||||
class CreditTransformer extends EntityTransformer
|
class CreditTransformer extends EntityTransformer
|
||||||
{
|
{
|
||||||
@ -30,6 +31,7 @@ class CreditTransformer extends EntityTransformer
|
|||||||
|
|
||||||
protected $availableIncludes = [
|
protected $availableIncludes = [
|
||||||
'activities',
|
'activities',
|
||||||
|
'client',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function includeActivities(Credit $credit)
|
public function includeActivities(Credit $credit)
|
||||||
@ -53,28 +55,13 @@ class CreditTransformer extends EntityTransformer
|
|||||||
return $this->includeCollection($credit->invitations, $transformer, CreditInvitation::class);
|
return $this->includeCollection($credit->invitations, $transformer, CreditInvitation::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
public function includeClient(Credit $credit): Item
|
||||||
public function includePayments(quote $credit)
|
{
|
||||||
{
|
$transformer = new ClientTransformer($this->serializer);
|
||||||
$transformer = new PaymentTransformer($this->account, $this->serializer, $credit);
|
|
||||||
|
|
||||||
return $this->includeCollection($credit->payments, $transformer, ENTITY_PAYMENT);
|
return $this->includeItem($credit->client, $transformer, Client::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function includeClient(quote $credit)
|
|
||||||
{
|
|
||||||
$transformer = new ClientTransformer($this->account, $this->serializer);
|
|
||||||
|
|
||||||
return $this->includeItem($credit->client, $transformer, ENTITY_CLIENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function includeExpenses(quote $credit)
|
|
||||||
{
|
|
||||||
$transformer = new ExpenseTransformer($this->account, $this->serializer);
|
|
||||||
|
|
||||||
return $this->includeCollection($credit->expenses, $transformer, ENTITY_EXPENSE);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public function includeDocuments(Credit $credit)
|
public function includeDocuments(Credit $credit)
|
||||||
{
|
{
|
||||||
$transformer = new DocumentTransformer($this->serializer);
|
$transformer = new DocumentTransformer($this->serializer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user