1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Factory/ClientFactory.php

39 lines
1005 B
PHP
Raw Normal View History

2019-01-27 23:13:12 +01:00
<?php
2019-05-11 05:32:07 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
2019-05-11 05:32:07 +02:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
2019-05-11 05:32:07 +02:00
*
2021-06-16 08:58:16 +02:00
* @license https://www.elastic.co/licensing/elastic-license
2019-05-11 05:32:07 +02:00
*/
2019-01-27 23:13:12 +01:00
namespace App\Factory;
use App\DataMapper\ClientSettings;
2019-01-27 23:13:12 +01:00
use App\Models\Client;
2019-09-26 15:00:51 +02:00
use Illuminate\Support\Str;
2019-01-27 23:13:12 +01:00
class ClientFactory
{
public static function create(int $company_id, int $user_id) :Client
{
$client = new Client;
$client->company_id = $company_id;
$client->user_id = $user_id;
$client->name = '';
$client->website = '';
$client->private_notes = '';
$client->public_notes = '';
$client->balance = 0;
$client->paid_to_date = 0;
2021-11-18 11:35:00 +01:00
$client->country_id = 840;
$client->is_deleted = 0;
$client->client_hash = Str::random(40);
$client->settings = ClientSettings::defaults();
return $client;
}
2019-01-27 23:13:12 +01:00
}