9f7d3dad9a7c2f09c0fc74364985637d24aaefae
[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 use Drupal\Component\Utility\Xss;
16 use Drupal\Core\Url;
17 {% else %}
18 use Drupal\Core\Entity\ContentEntityInterface;
19 {% endif %}
20 use Drupal\Core\Entity\EntityChangedInterface;
21 use Drupal\user\EntityOwnerInterface;
22 {% endblock %}
23
24 {% block class_declaration %}
25 /**
26  * Provides an interface for defining {{ label }} entities.
27  *
28  * @ingroup {{module}}
29  */
30 interface {{ entity_class }}Interface extends {% if revisionable %}RevisionableInterface, RevisionLogInterface{% else %} ContentEntityInterface{% endif %}, EntityChangedInterface, EntityOwnerInterface {% endblock %}
31 {% block class_methods %}
32   // Add get/set methods for your configuration properties here.
33
34 {% if bundle_entity_type %}
35   /**
36    * Gets the {{ label }} type.
37    *
38    * @return string
39    *   The {{ label }} type.
40    */
41   public function getType();
42
43 {% endif %}
44   /**
45    * Gets the {{ label }} name.
46    *
47    * @return string
48    *   Name of the {{ label }}.
49    */
50   public function getName();
51
52   /**
53    * Sets the {{ label }} name.
54    *
55    * @param string $name
56    *   The {{ label }} name.
57    *
58    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
59    *   The called {{ label }} entity.
60    */
61   public function setName($name);
62
63   /**
64    * Gets the {{ label }} creation timestamp.
65    *
66    * @return int
67    *   Creation timestamp of the {{ label }}.
68    */
69   public function getCreatedTime();
70
71   /**
72    * Sets the {{ label }} creation timestamp.
73    *
74    * @param int $timestamp
75    *   The {{ label }} creation timestamp.
76    *
77    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
78    *   The called {{ label }} entity.
79    */
80   public function setCreatedTime($timestamp);
81
82   /**
83    * Returns the {{ label }} published status indicator.
84    *
85    * Unpublished {{ label }} are only visible to restricted users.
86    *
87    * @return bool
88    *   TRUE if the {{ label }} is published.
89    */
90   public function isPublished();
91
92   /**
93    * Sets the published status of a {{ label }}.
94    *
95    * @param bool $published
96    *   TRUE to set this {{ label }} to published, FALSE to set it to unpublished.
97    *
98    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
99    *   The called {{ label }} entity.
100    */
101   public function setPublished($published);
102 {% if revisionable %}
103
104   /**
105    * Gets the {{ label }} revision creation timestamp.
106    *
107    * @return int
108    *   The UNIX timestamp of when this revision was created.
109    */
110   public function getRevisionCreationTime();
111
112   /**
113    * Sets the {{ label }} revision creation timestamp.
114    *
115    * @param int $timestamp
116    *   The UNIX timestamp of when this revision was created.
117    *
118    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
119    *   The called {{ label }} entity.
120    */
121   public function setRevisionCreationTime($timestamp);
122
123   /**
124    * Gets the {{ label }} revision author.
125    *
126    * @return \Drupal\user\UserInterface
127    *   The user entity for the revision author.
128    */
129   public function getRevisionUser();
130
131   /**
132    * Sets the {{ label }} revision author.
133    *
134    * @param int $uid
135    *   The user ID of the revision author.
136    *
137    * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
138    *   The called {{ label }} entity.
139    */
140   public function setRevisionUserId($uid);
141 {% endif %}
142 {% endblock %}