-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
RFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)Validator
Description
Description
It could be a great improvement if the Unique Constraint could take a errorPath parameter (like the UniqueEntity constraint) pointing to the field that is a duplicate. This will be even more relevant if this PR is merged.
Example
Using the example provided in the documentation:
<?php
// src/Entity/PointOfInterest.php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class PointOfInterest
{
#[Assert\Unique(fields: ['latitude', 'longitude'], errorPath: 'latitude')]
protected array $coordinates;
}Metadata
Metadata
Assignees
Labels
RFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)Validator