mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
36 lines
731 B
PHP
Executable File
36 lines
731 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Classes\Modules\Companies\Services;
|
|
|
|
|
|
use App\Classes\Modules\Companies\DataTransferObjects\CompanyObject;
|
|
use App\Models\Company;
|
|
|
|
class CreatesCompany
|
|
{
|
|
/** @var Company */
|
|
private $repository;
|
|
|
|
|
|
/**
|
|
* @param Company $repository
|
|
*/
|
|
public function __construct(Company $repository) {
|
|
$this->repository = $repository;
|
|
}
|
|
|
|
public function execute(CompanyObject $object) {
|
|
|
|
$model = $this->repository->create([
|
|
'marking' => $object->getMarking(),
|
|
'name' => $object->getName(),
|
|
'registration_no' => $object->getRegistrationNumber(),
|
|
'tax_no' => $object->getTaxNumber(),
|
|
]);
|
|
|
|
|
|
|
|
return $model;
|
|
|
|
}
|
|
} |