* @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\ConstraintValidator\Constraints; use PrestaShop\PrestaShop\Core\ConstraintValidator\UniqueStateIsoCodeValidator; use Symfony\Component\Validator\Constraint; /** * Unique state iso code validator constraint */ class UniqueStateIsoCode extends Constraint { /** * @var string */ public $message = 'This ISO code already exists. You cannot create two states with the same ISO code.'; /** * Exclude (or not) a specific State ID for the search of ISO Code * * @var int|null */ public $excludeStateId = null; /** * {@inheritdoc} */ public function getRequiredOptions() { return ['excludeStateId']; } /** * {@inheritdoc} */ public function validatedBy() { return UniqueStateIsoCodeValidator::class; } }