diff --git a/app/code/Magento/MediaContent/Model/GetAssetIdByContentStatus.php b/app/code/Magento/MediaContent/Model/GetAssetIdByContentStatus.php index 10f974ab104e2..f9ec4cff77bae 100644 --- a/app/code/Magento/MediaContent/Model/GetAssetIdByContentStatus.php +++ b/app/code/Magento/MediaContent/Model/GetAssetIdByContentStatus.php @@ -11,7 +11,7 @@ use Magento\MediaContentApi\Model\GetAssetIdByContentStatusInterface; /** - * Class GetAssetIdByContentStatus + * Class responsible to return Asset id by entity status */ class GetAssetIdByContentStatus implements GetAssetIdByContentStatusInterface { @@ -48,7 +48,8 @@ class GetAssetIdByContentStatus implements GetAssetIdByContentStatusInterface private $valueMap; /** - * GetContentIdByStatus constructor. + * GetAssetIdByContentStatus constructor. + * * @param ResourceConnection $resource * @param string $entityType * @param string $contentTable @@ -73,8 +74,7 @@ public function __construct( } /** - * @param string $value - * @return array + * @inheritDoc */ public function execute(string $value): array { diff --git a/app/code/Magento/MediaContent/Model/GetAssetIdByContentStatusComposite.php b/app/code/Magento/MediaContent/Model/GetAssetIdByContentStatusComposite.php index 72ea5354fae36..f62b3cd2ffb52 100644 --- a/app/code/Magento/MediaContent/Model/GetAssetIdByContentStatusComposite.php +++ b/app/code/Magento/MediaContent/Model/GetAssetIdByContentStatusComposite.php @@ -10,7 +10,7 @@ use Magento\MediaContentApi\Model\GetAssetIdByContentStatusInterface; /** - * Class GetAssetIdByContentStatusComposite + * Class responsible to return Asset ids by content status */ class GetAssetIdByContentStatusComposite implements GetAssetIdByContentStatusInterface { @@ -21,6 +21,7 @@ class GetAssetIdByContentStatusComposite implements GetAssetIdByContentStatusInt /** * GetAssetIdByContentStatusComposite constructor. + * * @param array $getAssetIdByContentStatusArray */ public function __construct($getAssetIdByContentStatusArray = []) @@ -29,14 +30,16 @@ public function __construct($getAssetIdByContentStatusArray = []) } /** - * @param string $value + * Get Asset ids by Content status + * + * @param string $status * @return array */ - public function execute(string $value): array + public function execute(string $status): array { $ids = []; foreach ($this->getAssetIdByContentStatusArray as $getAssetIdByContentStatus) { - $ids = array_merge($ids, $getAssetIdByContentStatus->execute($value)); + $ids = array_merge($ids, $getAssetIdByContentStatus->execute($status)); } return array_unique($ids); } diff --git a/app/code/Magento/MediaContent/Model/GetAssetIdByEavContentStatus.php b/app/code/Magento/MediaContent/Model/GetAssetIdByEavContentStatus.php index 9da0dc1cd3f53..c9d2e93182802 100644 --- a/app/code/Magento/MediaContent/Model/GetAssetIdByEavContentStatus.php +++ b/app/code/Magento/MediaContent/Model/GetAssetIdByEavContentStatus.php @@ -7,13 +7,12 @@ namespace Magento\MediaContent\Model; -use Magento\Eav\Api\Data\AttributeInterface; use Magento\Eav\Model\Config; use Magento\Framework\App\ResourceConnection; use Magento\MediaContentApi\Model\GetAssetIdByContentStatusInterface; /** - * Class GetAssetIdByEavContentStatus + * Class responsible to return Asset id by eav entity status */ class GetAssetIdByEavContentStatus implements GetAssetIdByContentStatusInterface { @@ -46,6 +45,7 @@ class GetAssetIdByEavContentStatus implements GetAssetIdByContentStatusInterface /** * GetAssetIdByEavContentStatus constructor. + * * @param ResourceConnection $resource * @param Config $config * @param string $attributeCode @@ -67,11 +67,10 @@ public function __construct( } /** - * @param string $value - * @return array + * @inheritDoc * @throws \Magento\Framework\Exception\LocalizedException */ - public function execute(string $value): array + public function execute(string $status): array { $statusAttribute = $this->config->getAttribute($this->entityType, $this->attributeCode); @@ -89,7 +88,7 @@ public function execute(string $value): array [] )->where( 'entity_eav_type.value = ?', - $this->getValueFromMap($value) + $this->getValueFromMap($status) ); $result = $this->connection->getConnection()->fetchAll($sql); @@ -100,6 +99,8 @@ public function execute(string $value): array } /** + * Get a value from a value map + * * @param string $value * @return string */ diff --git a/app/code/Magento/MediaContentApi/Model/GetAssetIdByContentStatusInterface.php b/app/code/Magento/MediaContentApi/Model/GetAssetIdByContentStatusInterface.php index 6eb609f68a389..cfd75a8274c4c 100644 --- a/app/code/Magento/MediaContentApi/Model/GetAssetIdByContentStatusInterface.php +++ b/app/code/Magento/MediaContentApi/Model/GetAssetIdByContentStatusInterface.php @@ -8,11 +8,13 @@ namespace Magento\MediaContentApi\Model; /** - * Interface used to return Asset id by content status (enabled, disabled). + * Interface used to return Asset id by content status. */ interface GetAssetIdByContentStatusInterface { /** + * This function returns asset ids by entity status + * * @param string $status * @return int[] */