14571877f8721a6fa4e2801799e492c10bca54b9
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / module / content-entity / src / ExampleInterface.php.twig
1 <?php
2
3 namespace Drupal\{{ machine_name }};
4
5 use Drupal\Core\Entity\ContentEntityInterface;
6 {% if author_base_field %}
7 use Drupal\user\EntityOwnerInterface;
8 {% endif %}
9 {% if changed_base_field %}
10 use Drupal\Core\Entity\EntityChangedInterface;
11 {% endif %}
12
13 /**
14  * Provides an interface defining {{ entity_type_label|article|lower }} entity type.
15  */
16 interface {{ class_prefix }}Interface extends ContentEntityInterface{% if author_base_field %}, EntityOwnerInterface{% endif %}{% if changed_base_field %}, EntityChangedInterface{% endif %} {
17
18 {% if title_base_field %}
19   /**
20    * Gets the {{ entity_type_label|lower }} title.
21    *
22    * @return string
23    *   Title of the {{ entity_type_label|lower }}.
24    */
25   public function getTitle();
26
27   /**
28    * Sets the {{ entity_type_label|lower }} title.
29    *
30    * @param string $title
31    *   The {{ entity_type_label|lower }} title.
32    *
33    * @return \Drupal\{{ machine_name }}\{{ class_prefix }}Interface
34    *   The called {{ entity_type_label|lower }} entity.
35    */
36   public function setTitle($title);
37
38 {% endif %}
39 {% if created_base_field %}
40   /**
41    * Gets the {{ entity_type_label|lower }} creation timestamp.
42    *
43    * @return int
44    *   Creation timestamp of the {{ entity_type_label|lower }}.
45    */
46   public function getCreatedTime();
47
48   /**
49    * Sets the {{ entity_type_label|lower }} creation timestamp.
50    *
51    * @param int $timestamp
52    *   The {{ entity_type_label|lower }} creation timestamp.
53    *
54    * @return \Drupal\{{ machine_name }}\{{ class_prefix }}Interface
55    *   The called {{ entity_type_label|lower }} entity.
56    */
57   public function setCreatedTime($timestamp);
58
59 {% endif %}
60 {% if status_base_field %}
61   /**
62    * Returns the {{ entity_type_label|lower }} status.
63    *
64    * @return bool
65    *   TRUE if the {{ entity_type_label|lower }} is enabled, FALSE otherwise.
66    */
67   public function isEnabled();
68
69   /**
70    * Sets the {{ entity_type_label|lower }} status.
71    *
72    * @param bool $status
73    *   TRUE to enable this {{ entity_type_label|lower }}, FALSE to disable.
74    *
75    * @return \Drupal\{{ machine_name }}\{{ class_prefix }}Interface
76    *   The called {{ entity_type_label|lower }} entity.
77    */
78   public function setStatus($status);
79
80 {% endif %}
81 }