* @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\Zone\Command; use PrestaShop\PrestaShop\Core\Domain\Zone\ValueObject\ZoneId; /** * Toggles zones status on bulk action */ class BulkToggleZoneStatusCommand { /** * @var bool */ private $expectedStatus; /** * @var array */ private $zoneIds; /** * @param bool $expectedStatus * @param array $zoneIds */ public function __construct(bool $expectedStatus, array $zoneIds) { $this->setZoneIds($zoneIds); $this->expectedStatus = $expectedStatus; } /** * @return bool */ public function getExpectedStatus(): bool { return $this->expectedStatus; } /** * @return array */ public function getZoneIds(): array { return $this->zoneIds; } /** * @param array $zoneIds */ private function setZoneIds(array $zoneIds): void { foreach ($zoneIds as $zoneId) { $this->zoneIds[] = new ZoneId((int) $zoneId); } } }