* @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\State\Command; use PrestaShop\PrestaShop\Core\Domain\State\ValueObject\StateId; /** * Toggles states status on bulk action */ class BulkToggleStateStatusCommand { /** * @var bool */ private $expectedStatus; /** * @var array */ private $stateIds; /** * @param bool $expectedStatus * @param array $stateIds */ public function __construct(bool $expectedStatus, array $stateIds) { $this->setStateIds($stateIds); $this->expectedStatus = $expectedStatus; } /** * @return bool */ public function getExpectedStatus(): bool { return $this->expectedStatus; } /** * @return array */ public function getStateIds(): array { return $this->stateIds; } /** * @param array $stateIds */ private function setStateIds(array $stateIds): void { foreach ($stateIds as $stateId) { $this->stateIds[] = new StateId((int) $stateId); } } }