mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-30 16:22:58 -04:00 
			
		
		
		
	* Remove unnecessary save() on invoice * Update copyright * Working on Credit Repository * Implement credits as a paymentable entity * Add credit_id to transformer * fix rules for update payment * Fix random deleted_at keys in transformers * Fix for password_protect check
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| /**
 | |
|  * Invoice Ninja (https://invoiceninja.com)
 | |
|  *
 | |
|  * @link https://github.com/invoiceninja/invoiceninja source repository
 | |
|  *
 | |
|  * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | |
|  *
 | |
|  * @license https://opensource.org/licenses/AAL
 | |
|  */
 | |
| 
 | |
| namespace App\Factory;
 | |
| 
 | |
| use App\Models\Product;
 | |
| 
 | |
| class ProductFactory
 | |
| {
 | |
|     public static function create(int $company_id, int $user_id) :Product
 | |
|     {
 | |
|         $product = new Product;
 | |
|         $product->company_id = $company_id;
 | |
|         $product->user_id = $user_id;
 | |
| 
 | |
|         $product->product_key = '';
 | |
|         $product->notes = '';
 | |
|         $product->cost = 0;
 | |
|         $product->price = 0;
 | |
|         $product->quantity = 1;
 | |
|         $product->tax_name1 = '';
 | |
|         $product->tax_rate1 = 0;
 | |
|         $product->tax_name2 = '';
 | |
|         $product->tax_rate2 = 0;
 | |
|         $product->custom_value1 = '';
 | |
|         $product->custom_value2 = '';
 | |
|         $product->custom_value3 = '';
 | |
|         $product->custom_value4 = '';
 | |
|         $product->is_deleted = 0;
 | |
| 
 | |
|         return $product;
 | |
|     }
 | |
| }
 |