mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 12:37:32 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			499 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			499 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php namespace App\Models;
 | |
| 
 | |
| use Illuminate\Database\Eloquent\SoftDeletes;
 | |
| 
 | |
| class Product extends EntityModel
 | |
| {
 | |
|     use SoftDeletes;
 | |
|     protected $dates = ['deleted_at'];
 | |
| 
 | |
|     public function getEntityType()
 | |
|     {
 | |
|         return ENTITY_PRODUCT;
 | |
|     }
 | |
| 
 | |
|     public static function findProductByKey($key)
 | |
|     {
 | |
|         return Product::scope()->where('product_key', '=', $key)->first();
 | |
|     }
 | |
| 
 | |
|     public function default_tax_rate()
 | |
|     {
 | |
|         return $this->belongsTo('App\Models\TaxRate');
 | |
|     }
 | |
| }
 |