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