diff --git a/Controller.js b/Controller.js index 8361a00..23060a8 100755 --- a/Controller.js +++ b/Controller.js @@ -15,8 +15,8 @@ jsOMS.Modules.ClientManagement = class { bind (id) { - const charts = typeof id === 'undefined' ? document.getElementsByTagName('canvas') : [document.getElementById(id)]; - let length = charts.length; + const charts = typeof id === 'undefined' ? document.getElementsByTagName('canvas') : [document.getElementById(id)]; + let length = charts.length; for (let i = 0; i < length; ++i) { if (charts[i].getAttribute('data-chart') === null @@ -28,8 +28,8 @@ jsOMS.Modules.ClientManagement = class { this.bindChart(charts[i]); } - const maps = typeof id === 'undefined' ? document.getElementsByClassName('map') : [document.getElementById(id)]; - length = maps.length; + const maps = typeof id === 'undefined' ? document.getElementsByClassName('map') : [document.getElementById(id)]; + length = maps.length; for (let i = 0; i < length; ++i) { this.bindMap(maps[i]); diff --git a/Models/Client.php b/Models/Client.php index 3569028..0f78aca 100755 --- a/Models/Client.php +++ b/Models/Client.php @@ -19,7 +19,6 @@ use Modules\Admin\Models\Address; use Modules\Admin\Models\NullAddress; use Modules\Editor\Models\EditorDoc; use Modules\Media\Models\Media; -use Modules\Media\Models\NullMedia; use Modules\Payment\Models\Payment; use Modules\Profile\Models\ContactElement; use Modules\Profile\Models\NullContactElement; @@ -51,14 +50,6 @@ class Client public Account $account; - /** - * Attributes. - * - * @var \Modules\Attribute\Models\Attribute[] - * @since 1.0.0 - */ - private array $attributes = []; - /** * Payments. * @@ -75,14 +66,6 @@ class Client */ private array $notes = []; - /** - * Files. - * - * @var Media[] - * @since 1.0.0 - */ - private array $files = []; - private array $contactElements = []; public Address $mainAddress; @@ -209,20 +192,6 @@ class Client 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. * @@ -358,58 +327,6 @@ class Client $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} */ @@ -433,5 +350,6 @@ class Client return $this->toArray(); } + use \Modules\Media\Models\MediaListTrait; use \Modules\Attribute\Models\AttributeHolderTrait; } diff --git a/Models/ClientL11nMapper.php b/Models/ClientL11nMapper.php index e421b57..a5a119a 100755 --- a/Models/ClientL11nMapper.php +++ b/Models/ClientL11nMapper.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 ClientL11n * @extends DataMapperFactory */ final class ClientL11nMapper extends DataMapperFactory