144e1150791cfd4f52ce55fe4b8fe1b269f4e5e3
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / module / content-entity / src / Entity / ExampleType.php.twig
1 <?php
2
3 namespace Drupal\{{ machine_name }}\Entity;
4
5 use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
6
7 /**
8  * Defines the {{ entity_type_label }} type configuration entity.
9  *
10  * @ConfigEntityType(
11  *   id = "{{ entity_type_id }}_type",
12  *   label = @Translation("{{ entity_type_label }} type"),
13  *   handlers = {
14  *     "form" = {
15  *       "add" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}TypeForm",
16  *       "edit" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}TypeForm",
17  *       "delete" = "Drupal\Core\Entity\EntityDeleteForm",
18  *     },
19  *     "list_builder" = "Drupal\{{ machine_name }}\{{ class_prefix }}TypeListBuilder",
20  *     "route_provider" = {
21  *       "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
22  *     }
23  *   },
24  *   admin_permission = "administer {{ entity_type_label|lower }} types",
25  *   bundle_of = "{{ entity_type_id }}",
26  *   config_prefix = "{{ entity_type_id }}_type",
27  *   entity_keys = {
28  *     "id" = "id",
29  *     "label" = "label",
30  *     "uuid" = "uuid"
31  *   },
32  *   links = {
33  *     "add-form" = "/admin/structure/{{ entity_type_id }}_types/add",
34  *     "edit-form" = "/admin/structure/{{ entity_type_id }}_types/manage/{{ '{' ~ entity_type_id ~ '_type}' }}",
35  *     "delete-form" = "/admin/structure/{{ entity_type_id }}_types/manage/{{ '{' ~ entity_type_id ~ '_type}' }}/delete",
36  *     "collection" = "/admin/structure/{{ entity_type_id }}_types"
37  *   },
38  *   config_export = {
39  *     "id",
40  *     "label",
41  *     "uuid",
42  *   }
43  * )
44  */
45 class {{ class_prefix }}Type extends ConfigEntityBundleBase {
46
47   /**
48    * The machine name of this {{ entity_type_label|lower }} type.
49    *
50    * @var string
51    */
52   protected $id;
53
54   /**
55    * The human-readable name of the {{ entity_type_label|lower }} type.
56    *
57    * @var string
58    */
59   protected $label;
60
61 }