X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Ftemplates%2Fmodule%2Fsrc%2FEntity%2Finterface-entity-content.php.twig;fp=vendor%2Fdrupal%2Fconsole%2Ftemplates%2Fmodule%2Fsrc%2FEntity%2Finterface-entity-content.php.twig;h=9f7d3dad9a7c2f09c0fc74364985637d24aaefae;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/drupal/console/templates/module/src/Entity/interface-entity-content.php.twig b/vendor/drupal/console/templates/module/src/Entity/interface-entity-content.php.twig new file mode 100644 index 000000000..9f7d3dad9 --- /dev/null +++ b/vendor/drupal/console/templates/module/src/Entity/interface-entity-content.php.twig @@ -0,0 +1,142 @@ +{% extends "base/class.php.twig" %} + +{% block file_path %} +\Drupal\{{module}}\Entity\{{ entity_class }}Interface. +{% endblock %} + +{% block namespace_class %} +namespace Drupal\{{module}}\Entity; +{% endblock %} + +{% block use_class %} +{% if revisionable %} +use Drupal\Core\Entity\RevisionLogInterface; +use Drupal\Core\Entity\RevisionableInterface; +use Drupal\Component\Utility\Xss; +use Drupal\Core\Url; +{% else %} +use Drupal\Core\Entity\ContentEntityInterface; +{% endif %} +use Drupal\Core\Entity\EntityChangedInterface; +use Drupal\user\EntityOwnerInterface; +{% endblock %} + +{% block class_declaration %} +/** + * Provides an interface for defining {{ label }} entities. + * + * @ingroup {{module}} + */ +interface {{ entity_class }}Interface extends {% if revisionable %}RevisionableInterface, RevisionLogInterface{% else %} ContentEntityInterface{% endif %}, EntityChangedInterface, EntityOwnerInterface {% endblock %} +{% block class_methods %} + // Add get/set methods for your configuration properties here. + +{% if bundle_entity_type %} + /** + * Gets the {{ label }} type. + * + * @return string + * The {{ label }} type. + */ + public function getType(); + +{% endif %} + /** + * Gets the {{ label }} name. + * + * @return string + * Name of the {{ label }}. + */ + public function getName(); + + /** + * Sets the {{ label }} name. + * + * @param string $name + * The {{ label }} name. + * + * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface + * The called {{ label }} entity. + */ + public function setName($name); + + /** + * Gets the {{ label }} creation timestamp. + * + * @return int + * Creation timestamp of the {{ label }}. + */ + public function getCreatedTime(); + + /** + * Sets the {{ label }} creation timestamp. + * + * @param int $timestamp + * The {{ label }} creation timestamp. + * + * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface + * The called {{ label }} entity. + */ + public function setCreatedTime($timestamp); + + /** + * Returns the {{ label }} published status indicator. + * + * Unpublished {{ label }} are only visible to restricted users. + * + * @return bool + * TRUE if the {{ label }} is published. + */ + public function isPublished(); + + /** + * Sets the published status of a {{ label }}. + * + * @param bool $published + * TRUE to set this {{ label }} to published, FALSE to set it to unpublished. + * + * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface + * The called {{ label }} entity. + */ + public function setPublished($published); +{% if revisionable %} + + /** + * Gets the {{ label }} revision creation timestamp. + * + * @return int + * The UNIX timestamp of when this revision was created. + */ + public function getRevisionCreationTime(); + + /** + * Sets the {{ label }} revision creation timestamp. + * + * @param int $timestamp + * The UNIX timestamp of when this revision was created. + * + * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface + * The called {{ label }} entity. + */ + public function setRevisionCreationTime($timestamp); + + /** + * Gets the {{ label }} revision author. + * + * @return \Drupal\user\UserInterface + * The user entity for the revision author. + */ + public function getRevisionUser(); + + /** + * Sets the {{ label }} revision author. + * + * @param int $uid + * The user ID of the revision author. + * + * @return \Drupal\{{ module }}\Entity\{{ entity_class }}Interface + * The called {{ label }} entity. + */ + public function setRevisionUserId($uid); +{% endif %} +{% endblock %}