Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / templates / module / src / Entity / interface-entity-content.php.twig
1 {% extends "base/class.php.twig" %}
2
3 {% block file_path %}
4 \Drupal\{{module}}\Entity\{{ entity_class }}Interface.
5 {% endblock %}
6
7 {% block namespace_class %}
8 namespace Drupal\{{module}}\Entity;
9 {% endblock %}
10
11 {% block use_class %}
12 {% if revisionable %}
13 use Drupal\Core\Entity\RevisionLogInterface;
14 use Drupal\Core\Entity\RevisionableInterface;
15 {% else %}
16 use Drupal\Core\Entity\ContentEntityInterface;
17 {% endif %}
18 use Drupal\Core\Entity\EntityChangedInterface;
19 use Drupal\user\EntityOwnerInterface;
20 {% endblock %}
21
22 {% block class_declaration %}
23 /**
24  * Provides an interface for defining {{ label }} entities.
25  *
26  * @ingroup {{module}}
27  */
28 interface {{ entity_class }}Interface extends {% if revisionable %}RevisionableInterface, RevisionLogInterface{% else %} ContentEntityInterface{% endif %}, EntityChangedInterface, EntityOwnerInterface {% endblock %}
29 {% block class_methods %}
30   // Add get/set methods for your configuration properties here.
31
32   /**
33    * Gets the {{ label }} name.
34    *
35    * @return string
36    *   Name of the {{ label }}.
37    */
38   public function getName();
39
40   /**
41    * Sets the {{ label }} name.
42    *
43    * @param string $name
44    *   The {{ label }} name.
45    *
46    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
47    *   The called {{ label }} entity.
48    */
49   public function setName($name);
50
51   /**
52    * Gets the {{ label }} creation timestamp.
53    *
54    * @return int
55    *   Creation timestamp of the {{ label }}.
56    */
57   public function getCreatedTime();
58
59   /**
60    * Sets the {{ label }} creation timestamp.
61    *
62    * @param int $timestamp
63    *   The {{ label }} creation timestamp.
64    *
65    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
66    *   The called {{ label }} entity.
67    */
68   public function setCreatedTime($timestamp);
69
70   /**
71    * Returns the {{ label }} published status indicator.
72    *
73    * Unpublished {{ label }} are only visible to restricted users.
74    *
75    * @return bool
76    *   TRUE if the {{ label }} is published.
77    */
78   public function isPublished();
79
80   /**
81    * Sets the published status of a {{ label }}.
82    *
83    * @param bool $published
84    *   TRUE to set this {{ label }} to published, FALSE to set it to unpublished.
85    *
86    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
87    *   The called {{ label }} entity.
88    */
89   public function setPublished($published);
90 {% if revisionable %}
91
92   /**
93    * Gets the {{ label }} revision creation timestamp.
94    *
95    * @return int
96    *   The UNIX timestamp of when this revision was created.
97    */
98   public function getRevisionCreationTime();
99
100   /**
101    * Sets the {{ label }} revision creation timestamp.
102    *
103    * @param int $timestamp
104    *   The UNIX timestamp of when this revision was created.
105    *
106    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
107    *   The called {{ label }} entity.
108    */
109   public function setRevisionCreationTime($timestamp);
110
111   /**
112    * Gets the {{ label }} revision author.
113    *
114    * @return \Drupal\user\UserInterface
115    *   The user entity for the revision author.
116    */
117   public function getRevisionUser();
118
119   /**
120    * Sets the {{ label }} revision author.
121    *
122    * @param int $uid
123    *   The user ID of the revision author.
124    *
125    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
126    *   The called {{ label }} entity.
127    */
128   public function setRevisionUserId($uid);
129 {% endif %}
130 {% endblock %}