From 08988b6f338395a3861f9ac5f048dbb23a818cb0 Mon Sep 17 00:00:00 2001 From: Nikolay-Fichter Date: Tue, 20 Jun 2023 13:45:26 +0500 Subject: [PATCH] task_83383 | Improvements in brand content management | --- lib/Dto/Brand.php | 42 ++++++++++++++++++++++++---- lib/Dto/BrandFillableProperties.php | 43 +++++++++++++++++++++++++---- lib/Dto/CreateBrandRequest.php | 42 ++++++++++++++++++++++++---- lib/Dto/ReplaceBrandRequest.php | 43 +++++++++++++++++++++++++---- 4 files changed, 146 insertions(+), 24 deletions(-) diff --git a/lib/Dto/Brand.php b/lib/Dto/Brand.php index 48156a9..316b971 100644 --- a/lib/Dto/Brand.php +++ b/lib/Dto/Brand.php @@ -65,7 +65,8 @@ class Brand implements ModelInterface, ArrayAccess 'is_active' => 'bool', 'code' => 'string', 'description' => 'string', - 'logo_url' => 'string' + 'logo_url' => 'string', + 'sort' => 'int', ]; /** @@ -82,7 +83,8 @@ class Brand implements ModelInterface, ArrayAccess 'is_active' => null, 'code' => null, 'description' => null, - 'logo_url' => null + 'logo_url' => null, + 'sort' => null, ]; /** @@ -99,7 +101,8 @@ class Brand implements ModelInterface, ArrayAccess 'is_active' => false, 'code' => true, 'description' => true, - 'logo_url' => true + 'logo_url' => true, + 'sort' => false, ]; /** @@ -197,7 +200,8 @@ class Brand implements ModelInterface, ArrayAccess 'is_active' => 'is_active', 'code' => 'code', 'description' => 'description', - 'logo_url' => 'logo_url' + 'logo_url' => 'logo_url', + 'sort' => 'sort', ]; /** @@ -214,7 +218,8 @@ class Brand implements ModelInterface, ArrayAccess 'is_active' => 'setIsActive', 'code' => 'setCode', 'description' => 'setDescription', - 'logo_url' => 'setLogoUrl' + 'logo_url' => 'setLogoUrl', + 'sort' => 'setSort', ]; /** @@ -231,7 +236,8 @@ class Brand implements ModelInterface, ArrayAccess 'is_active' => 'getIsActive', 'code' => 'getCode', 'description' => 'getDescription', - 'logo_url' => 'getLogoUrl' + 'logo_url' => 'getLogoUrl', + 'sort' => 'getSort', ]; /** @@ -303,6 +309,7 @@ class Brand implements ModelInterface, ArrayAccess $this->setIfExists('code', $data, null); $this->setIfExists('description', $data, null); $this->setIfExists('logo_url', $data, null); + $this->setIfExists('sort', $data, 0); } public function setIfExists(string $variableName, $fields, $defaultValue) @@ -339,6 +346,29 @@ class Brand implements ModelInterface, ArrayAccess return count($this->listInvalidProperties()) === 0; } + /** + * Gets sort + * + * @return int + */ + public function getSort(): int + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param int $sort + * + * @return $this + */ + public function setSort(int $sort): Brand + { + $this->container['sort'] = $sort; + + return $this; + } /** * Gets id diff --git a/lib/Dto/BrandFillableProperties.php b/lib/Dto/BrandFillableProperties.php index 15371e3..2d966aa 100644 --- a/lib/Dto/BrandFillableProperties.php +++ b/lib/Dto/BrandFillableProperties.php @@ -61,7 +61,8 @@ class BrandFillableProperties implements ModelInterface, ArrayAccess 'is_active' => 'bool', 'code' => 'string', 'description' => 'string', - 'logo_url' => 'string' + 'logo_url' => 'string', + 'sort' => 'int', ]; /** @@ -74,7 +75,8 @@ class BrandFillableProperties implements ModelInterface, ArrayAccess 'is_active' => null, 'code' => null, 'description' => null, - 'logo_url' => null + 'logo_url' => null, + 'sort' => null, ]; /** @@ -87,7 +89,8 @@ class BrandFillableProperties implements ModelInterface, ArrayAccess 'is_active' => false, 'code' => true, 'description' => true, - 'logo_url' => true + 'logo_url' => true, + 'sort' => false, ]; /** @@ -181,7 +184,8 @@ class BrandFillableProperties implements ModelInterface, ArrayAccess 'is_active' => 'is_active', 'code' => 'code', 'description' => 'description', - 'logo_url' => 'logo_url' + 'logo_url' => 'logo_url', + 'sort' => 'sort', ]; /** @@ -194,7 +198,8 @@ class BrandFillableProperties implements ModelInterface, ArrayAccess 'is_active' => 'setIsActive', 'code' => 'setCode', 'description' => 'setDescription', - 'logo_url' => 'setLogoUrl' + 'logo_url' => 'setLogoUrl', + 'sort' => 'setSort', ]; /** @@ -207,7 +212,8 @@ class BrandFillableProperties implements ModelInterface, ArrayAccess 'is_active' => 'getIsActive', 'code' => 'getCode', 'description' => 'getDescription', - 'logo_url' => 'getLogoUrl' + 'logo_url' => 'getLogoUrl', + 'sort' => 'getSort', ]; /** @@ -275,6 +281,7 @@ class BrandFillableProperties implements ModelInterface, ArrayAccess $this->setIfExists('code', $data, null); $this->setIfExists('description', $data, null); $this->setIfExists('logo_url', $data, null); + $this->setIfExists('sort', $data, 0); } public function setIfExists(string $variableName, $fields, $defaultValue) @@ -311,6 +318,30 @@ class BrandFillableProperties implements ModelInterface, ArrayAccess return count($this->listInvalidProperties()) === 0; } + /** + * Gets sort + * + * @return int + */ + public function getSort(): int + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param int $sort + * + * @return $this + */ + public function setSort(int $sort): BrandFillableProperties + { + $this->container['sort'] = $sort; + + return $this; + } + /** * Gets name diff --git a/lib/Dto/CreateBrandRequest.php b/lib/Dto/CreateBrandRequest.php index 1113956..1a3b474 100644 --- a/lib/Dto/CreateBrandRequest.php +++ b/lib/Dto/CreateBrandRequest.php @@ -61,7 +61,8 @@ class CreateBrandRequest implements ModelInterface, ArrayAccess 'is_active' => 'bool', 'code' => 'string', 'description' => 'string', - 'logo_url' => 'string' + 'logo_url' => 'string', + 'sort' => 'int', ]; /** @@ -74,7 +75,8 @@ class CreateBrandRequest implements ModelInterface, ArrayAccess 'is_active' => null, 'code' => null, 'description' => null, - 'logo_url' => null + 'logo_url' => null, + 'sort' => null, ]; /** @@ -87,7 +89,8 @@ class CreateBrandRequest implements ModelInterface, ArrayAccess 'is_active' => false, 'code' => true, 'description' => true, - 'logo_url' => true + 'logo_url' => true, + 'sort' => false, ]; /** @@ -181,7 +184,8 @@ class CreateBrandRequest implements ModelInterface, ArrayAccess 'is_active' => 'is_active', 'code' => 'code', 'description' => 'description', - 'logo_url' => 'logo_url' + 'logo_url' => 'logo_url', + 'sort' => 'sort', ]; /** @@ -194,7 +198,8 @@ class CreateBrandRequest implements ModelInterface, ArrayAccess 'is_active' => 'setIsActive', 'code' => 'setCode', 'description' => 'setDescription', - 'logo_url' => 'setLogoUrl' + 'logo_url' => 'setLogoUrl', + 'sort' => 'setSort', ]; /** @@ -207,7 +212,8 @@ class CreateBrandRequest implements ModelInterface, ArrayAccess 'is_active' => 'getIsActive', 'code' => 'getCode', 'description' => 'getDescription', - 'logo_url' => 'getLogoUrl' + 'logo_url' => 'getLogoUrl', + 'sort' => 'getSort', ]; /** @@ -275,6 +281,7 @@ class CreateBrandRequest implements ModelInterface, ArrayAccess $this->setIfExists('code', $data, null); $this->setIfExists('description', $data, null); $this->setIfExists('logo_url', $data, null); + $this->setIfExists('sort', $data, 0); } public function setIfExists(string $variableName, $fields, $defaultValue) @@ -311,6 +318,29 @@ class CreateBrandRequest implements ModelInterface, ArrayAccess return count($this->listInvalidProperties()) === 0; } + /** + * Gets sort + * + * @return int + */ + public function getSort(): int + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param int $sort + * + * @return $this + */ + public function setSort(int $sort): CreateBrandRequest + { + $this->container['sort'] = $sort; + + return $this; + } /** * Gets name diff --git a/lib/Dto/ReplaceBrandRequest.php b/lib/Dto/ReplaceBrandRequest.php index 208e511..9136a0a 100644 --- a/lib/Dto/ReplaceBrandRequest.php +++ b/lib/Dto/ReplaceBrandRequest.php @@ -61,7 +61,8 @@ class ReplaceBrandRequest implements ModelInterface, ArrayAccess 'is_active' => 'bool', 'code' => 'string', 'description' => 'string', - 'logo_url' => 'string' + 'logo_url' => 'string', + 'sort' => 'int', ]; /** @@ -74,7 +75,8 @@ class ReplaceBrandRequest implements ModelInterface, ArrayAccess 'is_active' => null, 'code' => null, 'description' => null, - 'logo_url' => null + 'logo_url' => null, + 'sort' => null, ]; /** @@ -87,7 +89,8 @@ class ReplaceBrandRequest implements ModelInterface, ArrayAccess 'is_active' => false, 'code' => true, 'description' => true, - 'logo_url' => true + 'logo_url' => true, + 'sort' => false, ]; /** @@ -181,7 +184,8 @@ class ReplaceBrandRequest implements ModelInterface, ArrayAccess 'is_active' => 'is_active', 'code' => 'code', 'description' => 'description', - 'logo_url' => 'logo_url' + 'logo_url' => 'logo_url', + 'sort' => 'sort', ]; /** @@ -194,7 +198,8 @@ class ReplaceBrandRequest implements ModelInterface, ArrayAccess 'is_active' => 'setIsActive', 'code' => 'setCode', 'description' => 'setDescription', - 'logo_url' => 'setLogoUrl' + 'logo_url' => 'setLogoUrl', + 'sort' => 'setSort', ]; /** @@ -207,7 +212,8 @@ class ReplaceBrandRequest implements ModelInterface, ArrayAccess 'is_active' => 'getIsActive', 'code' => 'getCode', 'description' => 'getDescription', - 'logo_url' => 'getLogoUrl' + 'logo_url' => 'getLogoUrl', + 'sort' => 'getSort', ]; /** @@ -275,6 +281,7 @@ class ReplaceBrandRequest implements ModelInterface, ArrayAccess $this->setIfExists('code', $data, null); $this->setIfExists('description', $data, null); $this->setIfExists('logo_url', $data, null); + $this->setIfExists('sort', $data, 0); } public function setIfExists(string $variableName, $fields, $defaultValue) @@ -312,6 +319,30 @@ class ReplaceBrandRequest implements ModelInterface, ArrayAccess } + /** + * Gets sort + * + * @return int + */ + public function getSort(): int + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param int $sort + * + * @return $this + */ + public function setSort(int $sort): ReplaceBrandRequest + { + $this->container['sort'] = $sort; + + return $this; + } + /** * Gets name * -- GitLab