1 {% extends "base/class.php.twig" %}
4 \Drupal\{{module}}\Entity\{{ entity_class }}Interface.
7 {% block namespace_class %}
8 namespace Drupal\{{module}}\Entity;
13 use Drupal\Core\Entity\RevisionLogInterface;
14 use Drupal\Core\Entity\RevisionableInterface;
15 use Drupal\Component\Utility\Xss;
18 use Drupal\Core\Entity\ContentEntityInterface;
20 use Drupal\Core\Entity\EntityChangedInterface;
21 use Drupal\user\EntityOwnerInterface;
24 {% block class_declaration %}
26 * Provides an interface for defining {{ label }} entities.
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.
34 {% if bundle_entity_type %}
36 * Gets the {{ label }} type.
39 * The {{ label }} type.
41 public function getType();
45 * Gets the {{ label }} name.
48 * Name of the {{ label }}.
50 public function getName();
53 * Sets the {{ label }} name.
56 * The {{ label }} name.
58 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
59 * The called {{ label }} entity.
61 public function setName($name);
64 * Gets the {{ label }} creation timestamp.
67 * Creation timestamp of the {{ label }}.
69 public function getCreatedTime();
72 * Sets the {{ label }} creation timestamp.
74 * @param int $timestamp
75 * The {{ label }} creation timestamp.
77 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
78 * The called {{ label }} entity.
80 public function setCreatedTime($timestamp);
83 * Returns the {{ label }} published status indicator.
85 * Unpublished {{ label }} are only visible to restricted users.
88 * TRUE if the {{ label }} is published.
90 public function isPublished();
93 * Sets the published status of a {{ label }}.
95 * @param bool $published
96 * TRUE to set this {{ label }} to published, FALSE to set it to unpublished.
98 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
99 * The called {{ label }} entity.
101 public function setPublished($published);
102 {% if revisionable %}
105 * Gets the {{ label }} revision creation timestamp.
108 * The UNIX timestamp of when this revision was created.
110 public function getRevisionCreationTime();
113 * Sets the {{ label }} revision creation timestamp.
115 * @param int $timestamp
116 * The UNIX timestamp of when this revision was created.
118 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
119 * The called {{ label }} entity.
121 public function setRevisionCreationTime($timestamp);
124 * Gets the {{ label }} revision author.
126 * @return \Drupal\user\UserInterface
127 * The user entity for the revision author.
129 public function getRevisionUser();
132 * Sets the {{ label }} revision author.
135 * The user ID of the revision author.
137 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
138 * The called {{ label }} entity.
140 public function setRevisionUserId($uid);