From a7bf9066ab331d96aeaa5d4b3cc8ece57300858a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 25 Apr 2023 01:51:28 +0000 Subject: [PATCH] bug fixes and subscription improvements --- Models/Supplier.php | 85 +---------------------------------- Models/SupplierL11nMapper.php | 2 +- 2 files changed, 3 insertions(+), 84 deletions(-) diff --git a/Models/Supplier.php b/Models/Supplier.php index 1285f5c..d7e602a 100755 --- a/Models/Supplier.php +++ b/Models/Supplier.php @@ -57,29 +57,13 @@ class Supplier public Account $account; /** - * Attributes. - * - * @var \Modules\Attribute\Models\Attribute[] - * @since 1.0.0 - */ - private array $attributes = []; - - /** - * Files. + * Notes. * * @var EditorDoc[] * @since 1.0.0 */ private array $notes = []; - /** - * Files. - * - * @var Media[] - * @since 1.0.0 - */ - private array $files = []; - private array $contactElements = []; private array $address = []; @@ -240,20 +224,6 @@ class Supplier return $this->notes; } - /** - * Add media. - * - * @param Media $file Media - * - * @return void - * - * @since 1.0.0 - */ - public function addFile(Media $file) : void - { - $this->files[] = $file; - } - /** * Get addresses. * @@ -355,58 +325,6 @@ class Supplier $this->contactElements[] = $element; } - /** - * Get files - * - * @return Media[] - * - * @since 1.0.0 - */ - public function getFiles() : array - { - return $this->files; - } - - /** - * Get media file by type - * - * @param int $type Media type - * - * @return Media - * - * @since 1.0.0 - */ - public function getFileByType(int $type) : Media - { - foreach ($this->files as $file) { - if ($file->hasMediaTypeId($type)) { - return $file; - } - } - - return new NullMedia(); - } - - /** - * Get all media files by type name - * - * @param string $type Media type - * - * @return Media - * - * @since 1.0.0 - */ - public function getFileByTypeName(string $type) : Media - { - foreach ($this->files as $file) { - if ($file->hasMediaTypeName($type)) { - return $file; - } - } - - return new NullMedia(); - } - /** * {@inheritdoc} */ @@ -430,5 +348,6 @@ class Supplier return $this->toArray(); } + use \Modules\Media\Models\MediaListTrait; use \Modules\Attribute\Models\AttributeHolderTrait; } diff --git a/Models/SupplierL11nMapper.php b/Models/SupplierL11nMapper.php index d479ee8..b13e835 100755 --- a/Models/SupplierL11nMapper.php +++ b/Models/SupplierL11nMapper.php @@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * @link https://jingga.app * @since 1.0.0 * - * @template T of BaseStringL11n + * @template T of SupplierL11n * @extends DataMapperFactory */ final class SupplierL11nMapper extends DataMapperFactory