* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Core\Domain\AttributeGroup\Command; use PrestaShop\PrestaShop\Core\Domain\AttributeGroup\Exception\AttributeGroupConstraintException; use PrestaShop\PrestaShop\Core\Domain\AttributeGroup\ValueObject\AttributeGroupId; /** * Deletes attribute groups in bulk action by provided ids */ final class BulkDeleteAttributeGroupCommand { /** * @var AttributeGroupId[] */ private $attributeGroupIds; /** * @param int[] $attributeGroupIds * * @throws AttributeGroupConstraintException */ public function __construct(array $attributeGroupIds) { $this->setAttributeGroupIds($attributeGroupIds); } /** * @return AttributeGroupId[] */ public function getAttributeGroupIds() { return $this->attributeGroupIds; } /** * @param array $attributeGroupIds * * @throws AttributeGroupConstraintException */ private function setAttributeGroupIds(array $attributeGroupIds) { foreach ($attributeGroupIds as $attributeGroupId) { $this->attributeGroupIds[] = new AttributeGroupId($attributeGroupId); } } }