forked from hechoendrupal/drupal-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentity.php.twig
More file actions
60 lines (55 loc) · 1.57 KB
/
Copy pathentity.php.twig
File metadata and controls
60 lines (55 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{% extends "base/class.php.twig" %}
{% block file_path %}
Drupal\{{ module }}\Entity\{{ entity_class }}.
{% endblock %}
{% block namespace_class %}
namespace Drupal\{{ module }}\Entity;
{% endblock %}
{% block use_class %}
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\{{ module }}\{{ entity_class }}Interface;
{% endblock %}
{% block class_declaration %}
/**
* Defines the {{ entity_class }} entity.
*
* @ConfigEntityType(
* id = "{{ entity_name }}",
* label = @Translation("{{ entity_class }}"),
* handlers = {
* "list_builder" = "Drupal\{{ module }}\Controller\{{ entity_class }}ListBuilder",
* "form" = {
* "add" = "Drupal\{{ module }}\Form\{{ entity_class }}Form",
* "edit" = "Drupal\{{ module }}\Form\{{ entity_class }}Form",
* "delete" = "Drupal\{{ module }}\Form\{{ entity_class }}DeleteForm"
* }
* },
* config_prefix = "{{ entity_name }}",
* admin_permission = "administer site configuration",
* entity_keys = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid"
* },
* links = {
* "edit-form" = "entity.{{ entity_name }}.edit_form",
* "delete-form" = "entity.{{ entity_name }}.delete_form",
* "collection" = "entity.{{ entity_name }}.collection"
* }
* )
*/
class {{ entity_class }} extends ConfigEntityBase implements {{ entity_class }}Interface {% endblock %}
{% block class_methods %}
/**
* The {{ entity_class }} ID.
*
* @var string
*/
protected $id;
/**
* The {{ entity_class }} label.
*
* @var string
*/
protected $label;
{% endblock %}