diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 6142211..a18df1a 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -17,6 +17,7 @@ namespace Modules\SupplierManagement\Controller; use Modules\Admin\Models\Account; use Modules\Admin\Models\Address; use Modules\Profile\Models\Profile; +use Modules\Profile\Models\ContactElementMapper; use Modules\SupplierManagement\Models\Supplier; use Modules\SupplierManagement\Models\SupplierMapper; use phpOMS\Message\Http\RequestStatusCode; @@ -89,7 +90,7 @@ final class ApiController extends Controller $addr->city = $request->getData('city') ?? ''; $addr->state = $request->getData('state') ?? ''; $addr->setCountry($request->getData('country') ?? ''); - $supplier->setMainAddress($addr); + $supplier->mainAddress = $addr; return $supplier; } diff --git a/Models/Supplier.php b/Models/Supplier.php index 72516ca..357a1a3 100644 --- a/Models/Supplier.php +++ b/Models/Supplier.php @@ -47,21 +47,19 @@ class Supplier private int $type = 0; - private $taxId = 0; + public string $info = ''; - private $info = ''; + private \DateTimeImmutable $createdAt; - private $createdAt = null; + public Profile $profile; - public $profile = null; + private array $files = []; - private $files = []; + private array $contactElements = []; - private $contactElements = []; + private array $address = []; - private $address = []; - - private $mainAddress; + public Address $mainAddress; /** * Constructor. @@ -169,32 +167,6 @@ class Supplier $this->type = $type; } - /** - * Get tax id. - * - * @return int - * - * @since 1.0.0 - */ - public function getTaxId() : int - { - return $this->taxId; - } - - /** - * Set tax id. - * - * @param int $taxId Tax id - * - * @return void - * - * @since 1.0.0 - */ - public function setTaxId(int $taxId) : void - { - $this->taxId = $taxId; - } - /** * Get info. * @@ -221,32 +193,6 @@ class Supplier $this->info = $info; } - /** - * Set main address - * - * @param int|Address $address Address - * - * @return void - * - * @since 1.0.0 - */ - public function setMainAddress($address) : void - { - $this->mainAddress = $address; - } - - /** - * Get main address - * - * @return int|Address - * - * @since 1.0.0 - */ - public function getMainAddress() - { - return $this->mainAddress; - } - /** * Get media. *