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;
16 use Drupal\Core\Entity\ContentEntityInterface;
18 use Drupal\Core\Entity\EntityChangedInterface;
19 use Drupal\user\EntityOwnerInterface;
22 {% block class_declaration %}
24 * Provides an interface for defining {{ label }} entities.
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.
33 * Gets the {{ label }} name.
36 * Name of the {{ label }}.
38 public function getName();
41 * Sets the {{ label }} name.
44 * The {{ label }} name.
46 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
47 * The called {{ label }} entity.
49 public function setName($name);
52 * Gets the {{ label }} creation timestamp.
55 * Creation timestamp of the {{ label }}.
57 public function getCreatedTime();
60 * Sets the {{ label }} creation timestamp.
62 * @param int $timestamp
63 * The {{ label }} creation timestamp.
65 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
66 * The called {{ label }} entity.
68 public function setCreatedTime($timestamp);
71 * Returns the {{ label }} published status indicator.
73 * Unpublished {{ label }} are only visible to restricted users.
76 * TRUE if the {{ label }} is published.
78 public function isPublished();
81 * Sets the published status of a {{ label }}.
83 * @param bool $published
84 * TRUE to set this {{ label }} to published, FALSE to set it to unpublished.
86 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
87 * The called {{ label }} entity.
89 public function setPublished($published);
93 * Gets the {{ label }} revision creation timestamp.
96 * The UNIX timestamp of when this revision was created.
98 public function getRevisionCreationTime();
101 * Sets the {{ label }} revision creation timestamp.
103 * @param int $timestamp
104 * The UNIX timestamp of when this revision was created.
106 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
107 * The called {{ label }} entity.
109 public function setRevisionCreationTime($timestamp);
112 * Gets the {{ label }} revision author.
114 * @return \Drupal\user\UserInterface
115 * The user entity for the revision author.
117 public function getRevisionUser();
120 * Sets the {{ label }} revision author.
123 * The user ID of the revision author.
125 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
126 * The called {{ label }} entity.
128 public function setRevisionUserId($uid);