1 {% extends "base/class.php.twig" %}
4 \Drupal\{{module}}\Entity\{{ entity_class }}Interface.
7 {% block namespace_class %}
8 namespace Drupal\{{module}}\Entity;
12 use Drupal\Core\Entity\ContentEntityInterface;
14 use Drupal\Core\Entity\RevisionLogInterface;
16 use Drupal\Core\Entity\EntityChangedInterface;
17 use Drupal\user\EntityOwnerInterface;
20 {% block class_declaration %}
22 * Provides an interface for defining {{ label }} entities.
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.
31 * Gets the {{ label }} name.
34 * Name of the {{ label }}.
36 public function getName();
39 * Sets the {{ label }} name.
42 * The {{ label }} name.
44 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
45 * The called {{ label }} entity.
47 public function setName($name);
50 * Gets the {{ label }} creation timestamp.
53 * Creation timestamp of the {{ label }}.
55 public function getCreatedTime();
58 * Sets the {{ label }} creation timestamp.
60 * @param int $timestamp
61 * The {{ label }} creation timestamp.
63 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
64 * The called {{ label }} entity.
66 public function setCreatedTime($timestamp);
69 * Returns the {{ label }} published status indicator.
71 * Unpublished {{ label }} are only visible to restricted users.
74 * TRUE if the {{ label }} is published.
76 public function isPublished();
79 * Sets the published status of a {{ label }}.
81 * @param bool $published
82 * TRUE to set this {{ label }} to published, FALSE to set it to unpublished.
84 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
85 * The called {{ label }} entity.
87 public function setPublished($published);
91 * Gets the {{ label }} revision creation timestamp.
94 * The UNIX timestamp of when this revision was created.
96 public function getRevisionCreationTime();
99 * Sets the {{ label }} revision creation timestamp.
101 * @param int $timestamp
102 * The UNIX timestamp of when this revision was created.
104 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
105 * The called {{ label }} entity.
107 public function setRevisionCreationTime($timestamp);
110 * Gets the {{ label }} revision author.
112 * @return \Drupal\user\UserInterface
113 * The user entity for the revision author.
115 public function getRevisionUser();
118 * Sets the {{ label }} revision author.
121 * The user ID of the revision author.
123 * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface
124 * The called {{ label }} entity.
126 public function setRevisionUserId($uid);