mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:17:35 -05:00 
			
		
		
		
	Include Documents in Invoice transformer
This commit is contained in:
		
							parent
							
								
									2f8b79891a
								
							
						
					
					
						commit
						2034c11795
					
				@ -28,7 +28,7 @@ class InvoiceTransformer extends EntityTransformer
 | 
				
			|||||||
        'invitations',
 | 
					        'invitations',
 | 
				
			||||||
        'payments',
 | 
					        'payments',
 | 
				
			||||||
        'client',
 | 
					        'client',
 | 
				
			||||||
        //'expenses',
 | 
					        'documents',
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function __construct($account = null, $serializer = null, $client = null)
 | 
					    public function __construct($account = null, $serializer = null, $client = null)
 | 
				
			||||||
@ -68,6 +68,12 @@ class InvoiceTransformer extends EntityTransformer
 | 
				
			|||||||
        return $this->includeCollection($invoice->expenses, $transformer, ENTITY_EXPENSE);
 | 
					        return $this->includeCollection($invoice->expenses, $transformer, ENTITY_EXPENSE);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function includeDocuments(Invoice $invoice)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $transformer = new DocumentTransformer($this->account, $this->serializer);
 | 
				
			||||||
 | 
					        return $this->includeCollection($invoice->documents, $transformer, ENTITY_DOCUMENT);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function transform(Invoice $invoice)
 | 
					    public function transform(Invoice $invoice)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user