2019-04-03 04:34:28 +02:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
2019-04-03 04:34:28 +02:00
|
|
|
|
|
|
|
namespace App\Factory;
|
|
|
|
|
|
|
|
use App\Models\Product;
|
|
|
|
|
|
|
|
class ProductFactory
|
|
|
|
{
|
2019-12-30 22:59:12 +01:00
|
|
|
public static function create(int $company_id, int $user_id) :Product
|
|
|
|
{
|
|
|
|
$product = new Product;
|
|
|
|
$product->company_id = $company_id;
|
|
|
|
$product->user_id = $user_id;
|
2019-04-03 04:34:28 +02:00
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
$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;
|
2019-04-03 04:34:28 +02:00
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
return $product;
|
|
|
|
}
|
2019-04-03 04:34:28 +02:00
|
|
|
}
|