* @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\CmsPage\Command; use PrestaShop\PrestaShop\Core\Domain\CmsPage\Exception\CmsPageException; use PrestaShop\PrestaShop\Core\Domain\CmsPage\ValueObject\CmsPageId; /** * Enables multiple cms pages. */ class BulkEnableCmsPageCommand { /** * @var CmsPageId[] */ private $cmsPages; /** * @param array $cmsPageIds * * @throws CmsPageException */ public function __construct(array $cmsPageIds) { $this->setCmsPages($cmsPageIds); } /** * @return CmsPageId[] */ public function getCmsPages() { return $this->cmsPages; } /** * @param array $cmsPageIds * * @throws CmsPageException */ private function setCmsPages(array $cmsPageIds) { foreach ($cmsPageIds as $cmsPageId) { $this->cmsPages[] = new CmsPageId($cmsPageId); } } }