PrestaShop Developer Conference
PrestaShop Developer Conference
Paris, France - November 30, 2023
Let's talk code, commerce and open source.

Warning: You are browsing the documentation for PrestaShop 1.7, which is outdated.

You might want to read an updated version of this page for the current version, PrestaShop 8. Read the updated version of this page

Learn how to upgrade to the latest version.

Feature domain

Feature Commands

AddFeatureCommand

PrestaShop\PrestaShop\Core\Domain\Feature\Command\AddFeatureCommand Adds new feature

Command details
Constructor parameters
  • $array $localizedNames
  • `$array $shopAssociation = array (
)`
Handler class PrestaShop\PrestaShop\Adapter\Feature\CommandHandler\AddFeatureHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Feature\CommandHandler\AddFeatureHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Feature\ValueObject\FeatureId

AddFeatureValueCommand

PrestaShop\PrestaShop\Core\Domain\Feature\Command\AddFeatureValueCommand Class AddFeatureValueCommand is used to add predefined feature values (as opposed to custom values which are only assigned to a Specific product)

Command details
Constructor parameters
  • $int $featureId
  • $array $localizedValues
Handler class PrestaShop\PrestaShop\Adapter\Feature\CommandHandler\AddFeatureValueHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Feature\CommandHandler\AddFeatureValueHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Feature\ValueObject\FeatureValueId

EditFeatureCommand

PrestaShop\PrestaShop\Core\Domain\Feature\Command\EditFeatureCommand Edit feature with given data.

Command details
Constructor parameters
  • $int $featureId
Handler class PrestaShop\PrestaShop\Adapter\Feature\CommandHandler\EditFeatureHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Feature\CommandHandler\EditFeatureHandlerInterface
Return type void

EditFeatureValueCommand

PrestaShop\PrestaShop\Core\Domain\Feature\Command\EditFeatureValueCommand Class EditFeatureValueCommand is used to edit FeatureValue content

Command details
Constructor parameters
  • $int $featureValueId
Handler class PrestaShop\PrestaShop\Adapter\Feature\CommandHandler\EditFeatureValueHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Feature\CommandHandler\EditFeatureValueHandlerInterface
Return type void

Feature Queries

GetFeatureForEditing

PrestaShop\PrestaShop\Core\Domain\Feature\Query\GetFeatureForEditing Retrieves feature data for editing

Query details
Constructor parameters
  • $int $featureId
Handler class PrestaShop\PrestaShop\Adapter\Feature\QueryHandler\GetFeatureForEditingHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Feature\QueryHandler\GetFeatureForEditingHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Feature\QueryResult\EditableFeature

GetFeatureValueForEditing

PrestaShop\PrestaShop\Core\Domain\Feature\Query\GetFeatureValueForEditing Retrieves feature value data for editing

Query details
Constructor parameters
  • $int $featureValueId
Handler class PrestaShop\PrestaShop\Adapter\Feature\QueryHandler\GetFeatureValueForEditingHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Feature\QueryHandler\GetFeatureValueForEditingHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Feature\QueryResult\EditableFeatureValue