* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\PrestaShop\Core\Domain\Store\Command; use PrestaShop\PrestaShop\Core\Domain\Store\ValueObject\StoreId; /** * Toggles store status on bulk action */ class BulkUpdateStoreStatusCommand { /** * @var bool */ private $expectedStatus; /** * @var array */ private $storeIds; /** * @param bool $expectedStatus * @param array $storeIds */ public function __construct(bool $expectedStatus, array $storeIds) { $this->setStoreIds($storeIds); $this->expectedStatus = $expectedStatus; } /** * @return array */ public function getStoreIds(): array { return $this->storeIds; } /** * @param array $storeIds */ private function setStoreIds(array $storeIds): void { foreach ($storeIds as $storeId) { $this->storeIds[] = new StoreId((int) $storeId); } } /** * @return bool */ public function getExpectedStatus(): bool { return $this->expectedStatus; } }