* @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\NoStateId; use PrestaShop\PrestaShop\Core\Domain\State\ValueObject\StateId; use PrestaShop\PrestaShop\Core\Domain\State\ValueObject\StateIdInterface; /** * Deletes state */ class DeleteStateCommand { /** * @var StateIdInterface */ private $stateId; /** * @param int $stateId */ public function __construct(int $stateId) { $this->stateId = $stateId !== NoStateId::NO_STATE_ID_VALUE ? new StateId($stateId) : new NoStateId(); } /** * @return StateIdInterface */ public function getStateId(): StateIdInterface { return $this->stateId; } }