Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| ExternalIdConstraint | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Drupal\crm_case_external_id\Plugin\Validation\Constraint; |
| 4 | |
| 5 | use Symfony\Component\Validator\Constraint; |
| 6 | |
| 7 | /** |
| 8 | * Checks that the submitted value is a unique integer. |
| 9 | * |
| 10 | * @Constraint( |
| 11 | * id = "CrmCaseExternalId", |
| 12 | * label = @Translation("External Crm Case Id", context = "Validation"), |
| 13 | * type = "integer" |
| 14 | * ) |
| 15 | */ |
| 16 | class ExternalIdConstraint extends Constraint { |
| 17 | |
| 18 | /** |
| 19 | * The message that will be shown if the value is not an integer. |
| 20 | * |
| 21 | * @var string |
| 22 | */ |
| 23 | public $notInteger = '%value is not an integer'; |
| 24 | |
| 25 | /** |
| 26 | * The message that will be shown if the value is not unique. |
| 27 | * |
| 28 | * @var string |
| 29 | */ |
| 30 | public $notUnique = '%value is not unique'; |
| 31 | |
| 32 | } |