Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / templates / module / src / Entity / entity.php.twig
1 {% extends "base/class.php.twig" %}
2
3 {% block file_path %}
4 \Drupal\{{ module }}\Entity\{{ entity_class }}.
5 {% endblock %}
6
7 {% block namespace_class %}
8 namespace Drupal\{{ module }}\Entity;
9 {% endblock %}
10
11 {% block use_class %}
12 {% if bundle_of %}
13 use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
14 {% else %}
15 use Drupal\Core\Config\Entity\ConfigEntityBase;
16 {% endif %}
17 {% endblock %}
18
19 {% block class_declaration %}
20 /**
21  * Defines the {{ label }} entity.
22  *
23  * @ConfigEntityType(
24  *   id = "{{ entity_name }}",
25  *   label = @Translation("{{ label }}"),
26  *   handlers = {
27  *     "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
28  *     "list_builder" = "Drupal\{{ module }}\{{ entity_class }}ListBuilder",
29  *     "form" = {
30  *       "add" = "Drupal\{{ module }}\Form\{{ entity_class }}Form",
31  *       "edit" = "Drupal\{{ module }}\Form\{{ entity_class }}Form",
32  *       "delete" = "Drupal\{{ module }}\Form\{{ entity_class }}DeleteForm"
33  *     },
34  *     "route_provider" = {
35  *       "html" = "Drupal\{{ module }}\{{ entity_class }}HtmlRouteProvider",
36  *     },
37  *   },
38  *   config_prefix = "{{ entity_name }}",
39  *   admin_permission = "administer site configuration",
40 {% if bundle_of %}
41  *   bundle_of = "{{ bundle_of }}",
42 {% endif %}
43  *   entity_keys = {
44  *     "id" = "id",
45  *     "label" = "label",
46  *     "uuid" = "uuid"
47  *   },
48  *   links = {
49  *     "canonical" = "{{ base_path }}/{{ entity_name }}/{{ '{'~entity_name~'}' }}",
50  *     "add-form" = "{{ base_path }}/{{ entity_name }}/add",
51  *     "edit-form" = "{{ base_path }}/{{ entity_name }}/{{ '{'~entity_name~'}' }}/edit",
52  *     "delete-form" = "{{ base_path }}/{{ entity_name }}/{{ '{'~entity_name~'}' }}/delete",
53  *     "collection" = "{{ base_path }}/{{ entity_name }}"
54  *   }
55  * )
56  */
57 class {{ entity_class }} extends {% if bundle_of %}ConfigEntityBundleBase{% else %}ConfigEntityBase{% endif %} implements {{ entity_class }}Interface {% endblock %}
58 {% block class_methods %}
59   /**
60    * The {{ label }} ID.
61    *
62    * @var string
63    */
64   protected $id;
65
66   /**
67    * The {{ label }} label.
68    *
69    * @var string
70    */
71   protected $label;
72 {% endblock %}