State domain

State Commands

AddStateCommand

PrestaShop\PrestaShop\Core\Domain\State\Command\AddStateCommand Creates state with provided data

Command details
Constructor parameters
  • $int $countryId
  • $int $zoneId
  • $string $name
  • $string $isoCode
  • $bool $active
Handler class PrestaShop\PrestaShop\Adapter\State\CommandHandler\AddStateHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\State\CommandHandler\AddStateHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\State\ValueObject\StateId

BulkDeleteStateCommand

PrestaShop\PrestaShop\Core\Domain\State\Command\BulkDeleteStateCommand Deletes states on bulk action

Command details
Constructor parameters
  • $array $stateIds
Handler class PrestaShop\PrestaShop\Adapter\State\CommandHandler\BulkDeleteStateHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\State\CommandHandler\BulkDeleteStateHandlerInterface
Return type void

BulkToggleStateStatusCommand

PrestaShop\PrestaShop\Core\Domain\State\Command\BulkToggleStateStatusCommand Toggles states status on bulk action

Command details
Constructor parameters
  • $bool $expectedStatus
  • $array $stateIds
Handler class PrestaShop\PrestaShop\Adapter\State\CommandHandler\BulkToggleStateStatusHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\State\CommandHandler\BulkToggleStateStatusHandlerInterface
Return type void

DeleteStateCommand

PrestaShop\PrestaShop\Core\Domain\State\Command\DeleteStateCommand Deletes state

Command details
Constructor parameters
  • $int $stateId
Handler class PrestaShop\PrestaShop\Adapter\State\CommandHandler\DeleteStateHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\State\CommandHandler\DeleteStateHandlerInterface
Return type void

EditStateCommand

PrestaShop\PrestaShop\Core\Domain\State\Command\EditStateCommand Edits state with provided data

Command details
Constructor parameters
  • $int $stateId
Handler class PrestaShop\PrestaShop\Adapter\State\CommandHandler\EditStateHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\State\CommandHandler\EditStateHandlerInterface
Return type void

ToggleStateStatusCommand

PrestaShop\PrestaShop\Core\Domain\State\Command\ToggleStateStatusCommand Class ToggleStateStatusCommand is responsible for toggling state status

Command details
Constructor parameters
  • $int $stateId
Handler class PrestaShop\PrestaShop\Adapter\State\CommandHandler\ToggleStateStatusHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\State\CommandHandler\ToggleStateStatusHandlerInterface
Return type void

State Queries

GetStateForEditing

PrestaShop\PrestaShop\Core\Domain\State\Query\GetStateForEditing Gets state for editing in back office

Query details
Constructor parameters
  • $int $stateId
Handler class PrestaShop\PrestaShop\Adapter\State\QueryHandler\GetStateForEditingHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\State\QueryHandler\GetStateForEditingHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\State\QueryResult\EditableState