Pull merge.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / plugin / constraint.twig
1 <?php
2
3 namespace Drupal\{{ machine_name }}\Plugin\Validation\Constraint;
4
5 use Symfony\Component\Validator\Constraint;
6
7 /**
8  * Provides {{ plugin_label|article }} constraint.
9  *
10  * @Constraint(
11  *   id = "{{ plugin_id }}",
12  *   label = @Translation("{{ plugin_label }}", context = "Validation"),
13  * )
14 {% if input_type == 'entity' %}
15  *
16  * @DCG
17  * To apply this constraint on a particular field implement
18  * hook_entity_type_build().
19 {% elseif input_type == 'item_list' %}
20  *
21  * @DCG
22  * To apply this constraint on third party entity types implement either
23  * hook_entity_base_field_info_alter() or hook_entity_bundle_field_info_alter().
24 {% elseif input_type == 'item' %}
25  *
26  * @DCG
27  * To apply this constraint on third party field types. Implement
28  * hook_field_info_alter().
29 {% endif %}
30  */
31 class {{ class }} extends Constraint {
32
33   public $errorMessage = 'The error message.';
34
35 }