mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 06:07:32 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			75 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php namespace App\Models;
 | |
| 
 | |
| use Laracasts\Presenter\PresentableTrait;
 | |
| use Illuminate\Database\Eloquent\SoftDeletes;
 | |
| 
 | |
| /**
 | |
|  * Class InvoiceItem
 | |
|  */
 | |
| class InvoiceItem extends EntityModel
 | |
| {
 | |
|     use PresentableTrait;
 | |
|     use SoftDeletes;
 | |
| 
 | |
|     /**
 | |
|      * @var string
 | |
|      */
 | |
|     protected $presenter = 'App\Ninja\Presenters\InvoiceItemPresenter';
 | |
| 
 | |
|     /**
 | |
|      * @var array
 | |
|      */
 | |
|     protected $dates = ['deleted_at'];
 | |
| 
 | |
|     /**
 | |
|      * @return mixed
 | |
|      */
 | |
|     public function getEntityType()
 | |
|     {
 | |
|         return ENTITY_INVOICE_ITEM;
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @var array
 | |
|      */
 | |
|     protected $fillable = [
 | |
|         'tax_name1',
 | |
|         'tax_rate1',
 | |
|         'tax_name2',
 | |
|         'tax_rate2',
 | |
|     ];
 | |
| 
 | |
|     /**
 | |
|      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
 | |
|      */
 | |
|     public function invoice()
 | |
|     {
 | |
|         return $this->belongsTo('App\Models\Invoice');
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return mixed
 | |
|      */
 | |
|     public function user()
 | |
|     {
 | |
|         return $this->belongsTo('App\Models\User')->withTrashed();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
 | |
|      */
 | |
|     public function product()
 | |
|     {
 | |
|         return $this->belongsTo('App\Models\Product');
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
 | |
|      */
 | |
|     public function account()
 | |
|     {
 | |
|         return $this->belongsTo('App\Models\Account');
 | |
|     }
 | |
| 
 | |
| }
 |