From 4ccdbd75fc239e2997d3e22bb7c6276cb7612980 Mon Sep 17 00:00:00 2001 From: Nikolay-Fichter Date: Thu, 13 Apr 2023 16:00:59 +0500 Subject: [PATCH] task_83453 | Refinement of properties for the filter --- lib/Dto/CreatePropertyRequest.php | 42 ++++++++++++++++++---- lib/Dto/Property.php | 45 ++++++++++++++++++++---- lib/Dto/PropertyFillableProperties.php | 48 +++++++++++++++++++++----- lib/Dto/ReplacePropertyRequest.php | 43 +++++++++++++++++++---- 4 files changed, 150 insertions(+), 28 deletions(-) diff --git a/lib/Dto/CreatePropertyRequest.php b/lib/Dto/CreatePropertyRequest.php index a0e7316..b545ffb 100644 --- a/lib/Dto/CreatePropertyRequest.php +++ b/lib/Dto/CreatePropertyRequest.php @@ -69,7 +69,8 @@ class CreatePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => 'bool', 'is_required' => 'bool', 'has_directory' => 'bool', - 'is_moderated' => 'bool' + 'is_moderated' => 'bool', + 'sort' => 'integer', ]; /** @@ -90,7 +91,8 @@ class CreatePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => null, 'is_required' => null, 'has_directory' => null, - 'is_moderated' => null + 'is_moderated' => null, + 'sort' => null, ]; /** @@ -111,7 +113,8 @@ class CreatePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => false, 'is_required' => false, 'has_directory' => false, - 'is_moderated' => false + 'is_moderated' => false, + 'sort' => true, ]; /** @@ -213,7 +216,8 @@ class CreatePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => 'is_active', 'is_required' => 'is_required', 'has_directory' => 'has_directory', - 'is_moderated' => 'is_moderated' + 'is_moderated' => 'is_moderated', + 'sort' => 'sort', ]; /** @@ -234,7 +238,8 @@ class CreatePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => 'setIsActive', 'is_required' => 'setIsRequired', 'has_directory' => 'setHasDirectory', - 'is_moderated' => 'setIsModerated' + 'is_moderated' => 'setIsModerated', + 'sort' => 'setSort', ]; /** @@ -255,7 +260,8 @@ class CreatePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => 'getIsActive', 'is_required' => 'getIsRequired', 'has_directory' => 'getHasDirectory', - 'is_moderated' => 'getIsModerated' + 'is_moderated' => 'getIsModerated', + 'sort' => 'getSort', ]; /** @@ -331,6 +337,7 @@ class CreatePropertyRequest implements ModelInterface, ArrayAccess $this->setIfExists('is_required', $data, null); $this->setIfExists('has_directory', $data, null); $this->setIfExists('is_moderated', $data, null); + $this->setIfExists('sort', $data, 500); } public function setIfExists(string $variableName, $fields, $defaultValue) @@ -367,6 +374,29 @@ class CreatePropertyRequest implements ModelInterface, ArrayAccess return count($this->listInvalidProperties()) === 0; } + /** + * Gets sort + * + * @return int|null + */ + public function getSort() + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param int $sort Значение сортировки + * + * @return $this + */ + public function setSort(int $sort) + { + $this->container['sort'] = $sort; + + return $this; + } /** * Gets name diff --git a/lib/Dto/Property.php b/lib/Dto/Property.php index 41bff00..f13b56f 100644 --- a/lib/Dto/Property.php +++ b/lib/Dto/Property.php @@ -75,6 +75,7 @@ class Property implements ModelInterface, ArrayAccess 'is_required' => 'bool', 'has_directory' => 'bool', 'is_moderated' => 'bool', + 'sort' => 'integer', 'directory' => '\Ensi\PimClient\Dto\AttributeDirectoryValue[]' ]; @@ -102,6 +103,7 @@ class Property implements ModelInterface, ArrayAccess 'is_required' => null, 'has_directory' => null, 'is_moderated' => null, + 'sort' => null, 'directory' => null ]; @@ -129,7 +131,8 @@ class Property implements ModelInterface, ArrayAccess 'is_required' => false, 'has_directory' => false, 'is_moderated' => false, - 'directory' => false + 'directory' => false, + 'sort' => true, ]; /** @@ -159,7 +162,7 @@ class Property implements ModelInterface, ArrayAccess return self::$openAPIFormats; } - /** + /** * Array of property to nullable mappings. Used for (de)serialization * * @return array @@ -237,7 +240,8 @@ class Property implements ModelInterface, ArrayAccess 'is_required' => 'is_required', 'has_directory' => 'has_directory', 'is_moderated' => 'is_moderated', - 'directory' => 'directory' + 'directory' => 'directory', + 'sort' => 'sort', ]; /** @@ -264,7 +268,8 @@ class Property implements ModelInterface, ArrayAccess 'is_required' => 'setIsRequired', 'has_directory' => 'setHasDirectory', 'is_moderated' => 'setIsModerated', - 'directory' => 'setDirectory' + 'directory' => 'setDirectory', + 'sort' => 'setSort', ]; /** @@ -291,7 +296,8 @@ class Property implements ModelInterface, ArrayAccess 'is_required' => 'getIsRequired', 'has_directory' => 'getHasDirectory', 'is_moderated' => 'getIsModerated', - 'directory' => 'getDirectory' + 'directory' => 'getDirectory', + 'sort' => 'getSort', ]; /** @@ -335,9 +341,9 @@ class Property implements ModelInterface, ArrayAccess return self::$openAPIModelName; } - - + + /** * Associative array for storing property values @@ -373,6 +379,7 @@ class Property implements ModelInterface, ArrayAccess $this->setIfExists('has_directory', $data, null); $this->setIfExists('is_moderated', $data, null); $this->setIfExists('directory', $data, null); + $this->setIfExists('sort', $data, 500); } public function setIfExists(string $variableName, $fields, $defaultValue) @@ -409,6 +416,30 @@ class Property implements ModelInterface, ArrayAccess return count($this->listInvalidProperties()) === 0; } + /** + * Gets sort + * + * @return int|null + */ + public function getSort() + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param int $sort Значение сортировки + * + * @return $this + */ + public function setSort(int $sort) + { + $this->container['sort'] = $sort; + + return $this; + } + /** * Gets id diff --git a/lib/Dto/PropertyFillableProperties.php b/lib/Dto/PropertyFillableProperties.php index d0d8176..0f25396 100644 --- a/lib/Dto/PropertyFillableProperties.php +++ b/lib/Dto/PropertyFillableProperties.php @@ -69,7 +69,8 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess 'is_active' => 'bool', 'is_required' => 'bool', 'has_directory' => 'bool', - 'is_moderated' => 'bool' + 'is_moderated' => 'bool', + 'sort' => 'integer', ]; /** @@ -90,7 +91,8 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess 'is_active' => null, 'is_required' => null, 'has_directory' => null, - 'is_moderated' => null + 'is_moderated' => null, + 'sort' => null, ]; /** @@ -111,7 +113,8 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess 'is_active' => false, 'is_required' => false, 'has_directory' => false, - 'is_moderated' => false + 'is_moderated' => false, + 'sort' => true, ]; /** @@ -141,7 +144,7 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess return self::$openAPIFormats; } - /** + /** * Array of property to nullable mappings. Used for (de)serialization * * @return array @@ -213,7 +216,8 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess 'is_active' => 'is_active', 'is_required' => 'is_required', 'has_directory' => 'has_directory', - 'is_moderated' => 'is_moderated' + 'is_moderated' => 'is_moderated', + 'sort' => 'sort' ]; /** @@ -234,7 +238,8 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess 'is_active' => 'setIsActive', 'is_required' => 'setIsRequired', 'has_directory' => 'setHasDirectory', - 'is_moderated' => 'setIsModerated' + 'is_moderated' => 'setIsModerated', + 'sort' => 'setSort', ]; /** @@ -255,7 +260,8 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess 'is_active' => 'getIsActive', 'is_required' => 'getIsRequired', 'has_directory' => 'getHasDirectory', - 'is_moderated' => 'getIsModerated' + 'is_moderated' => 'getIsModerated', + 'sort' => 'getSort', ]; /** @@ -299,9 +305,9 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess return self::$openAPIModelName; } - - + + /** * Associative array for storing property values @@ -331,6 +337,7 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess $this->setIfExists('is_required', $data, null); $this->setIfExists('has_directory', $data, null); $this->setIfExists('is_moderated', $data, null); + $this->setIfExists('sort', $data, 500); } public function setIfExists(string $variableName, $fields, $defaultValue) @@ -367,6 +374,29 @@ class PropertyFillableProperties implements ModelInterface, ArrayAccess return count($this->listInvalidProperties()) === 0; } + /** + * Gets sort + * + * @return int|null + */ + public function getSort() + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param int $sort Значение сортировки + * + * @return $this + */ + public function setSort(int $sort) + { + $this->container['sort'] = $sort; + + return $this; + } /** * Gets name diff --git a/lib/Dto/ReplacePropertyRequest.php b/lib/Dto/ReplacePropertyRequest.php index 30db77c..877f803 100644 --- a/lib/Dto/ReplacePropertyRequest.php +++ b/lib/Dto/ReplacePropertyRequest.php @@ -69,7 +69,8 @@ class ReplacePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => 'bool', 'is_required' => 'bool', 'has_directory' => 'bool', - 'is_moderated' => 'bool' + 'is_moderated' => 'bool', + 'sort' => 'integer', ]; /** @@ -90,7 +91,8 @@ class ReplacePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => null, 'is_required' => null, 'has_directory' => null, - 'is_moderated' => null + 'is_moderated' => null, + 'sort' => null, ]; /** @@ -111,7 +113,8 @@ class ReplacePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => false, 'is_required' => false, 'has_directory' => false, - 'is_moderated' => false + 'is_moderated' => false, + 'sort' => true, ]; /** @@ -213,7 +216,8 @@ class ReplacePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => 'is_active', 'is_required' => 'is_required', 'has_directory' => 'has_directory', - 'is_moderated' => 'is_moderated' + 'is_moderated' => 'is_moderated', + 'sort' => 'sort' ]; /** @@ -234,7 +238,8 @@ class ReplacePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => 'setIsActive', 'is_required' => 'setIsRequired', 'has_directory' => 'setHasDirectory', - 'is_moderated' => 'setIsModerated' + 'is_moderated' => 'setIsModerated', + 'sort' => 'setSort', ]; /** @@ -255,7 +260,8 @@ class ReplacePropertyRequest implements ModelInterface, ArrayAccess 'is_active' => 'getIsActive', 'is_required' => 'getIsRequired', 'has_directory' => 'getHasDirectory', - 'is_moderated' => 'getIsModerated' + 'is_moderated' => 'getIsModerated', + 'sort' => 'getSort', ]; /** @@ -331,6 +337,7 @@ class ReplacePropertyRequest implements ModelInterface, ArrayAccess $this->setIfExists('is_required', $data, null); $this->setIfExists('has_directory', $data, null); $this->setIfExists('is_moderated', $data, null); + $this->setIfExists('sort', $data, 500); } public function setIfExists(string $variableName, $fields, $defaultValue) @@ -367,6 +374,30 @@ class ReplacePropertyRequest implements ModelInterface, ArrayAccess return count($this->listInvalidProperties()) === 0; } + /** + * Gets sort + * + * @return int|null + */ + public function getSort() + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param int $sort Значение сортировки + * + * @return $this + */ + public function setSort(int $sort) + { + $this->container['sort'] = $sort; + + return $this; + } + /** * Gets name -- GitLab