Entity::__construct

public Entity::__construct(array $values, $entity_type) Constructs an Entity object. Parameters array $values: An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified. string $entity_type: The type of the entity to create. File core/lib/Drupal/Core/Entity/Entity.php, line 58 Class Entity Defines a base entity class. Namespace Drupal\Core\Entity Code public function __construct(array $values, $entity_type) { $this->enti

Entity::uuidGenerator

protected Entity::uuidGenerator() Gets the UUID generator. Return value \Drupal\Component\Uuid\UuidInterface File core/lib/Drupal/Core/Entity/Entity.php, line 104 Class Entity Defines a base entity class. Namespace Drupal\Core\Entity Code protected function uuidGenerator() { return \Drupal::service('uuid'); }

Entity::uuid

public Entity::uuid() Gets the entity UUID (Universally Unique Identifier). The UUID is guaranteed to be unique and can be used to identify an entity across multiple systems. Return value string|null The UUID of the entity, or NULL if the entity does not have one. Overrides EntityInterface::uuid File core/lib/Drupal/Core/Entity/Entity.php, line 118 Class Entity Defines a base entity class. Namespace Drupal\Core\Entity Code public function uuid() { return isset($this->uuid) ? $thi

Entity::urlRouteParameters

protected Entity::urlRouteParameters($rel) Gets an array of placeholders for this entity. Individual entity classes may override this method to add additional placeholders if desired. If so, they should be sure to replicate the property caching logic. Parameters string $rel: The link relationship type, for example: canonical or edit-form. Return value array An array of URI placeholders. File core/lib/Drupal/Core/Entity/Entity.php, line 304 Class Entity Defines a base entity class. Name

Entity::urlInfo

public Entity::urlInfo($rel = 'canonical', array $options = []) Gets the URL object for the entity. Parameters string $rel: The link relationship type, for example: canonical or edit-form. array $options: See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the available options. Return value \Drupal\Core\Url The URL object. Overrides EntityInterface::urlInfo Deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0 Use \Drupal\Core\Entity\EntityInterface::toUrl(

Entity::url

public Entity::url($rel = 'canonical', $options = array()) Gets the public URL for this entity. Parameters string $rel: The link relationship type, for example: canonical or edit-form. array $options: See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the available options. Return value string The URL for this entity. Overrides EntityInterface::url Deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0 Please use toUrl() instead. See also \Drupal\Core\Enti

Entity::uriRelationships

public Entity::uriRelationships() Gets a list of URI relationships supported by this entity. Return value string[] An array of link relationships supported by this entity. Overrides EntityInterface::uriRelationships File core/lib/Drupal/Core/Entity/Entity.php, line 325 Class Entity Defines a base entity class. Namespace Drupal\Core\Entity Code public function uriRelationships() { return array_keys($this->linkTemplates()); }

Entity::toUrl

public Entity::toUrl($rel = 'canonical', array $options = []) Gets the URL object for the entity. The entity must have an id already. Content entities usually get their IDs by saving them. URI templates might be set in the links array in an annotation, for example: links = { "canonical" = "/node/{node}", "edit-form" = "/node/{node}/edit", "version-history" = "/node/{node}/revisions" } or specified in a callback function set like: uri_callback = "comment_uri", If the path is not set in

Entity::toLink

public Entity::toLink($text = NULL, $rel = 'canonical', array $options = []) Generates the HTML for a link to this entity. Parameters string|null $text: (optional) The link text for the anchor tag as a translated string. If NULL, it will use the entity's label. Defaults to NULL. string $rel: (optional) The link relationship type. Defaults to 'canonical'. array $options: See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the available options. Return value \Drupal\Core\Lin

Entity::toArray

public Entity::toArray() Gets an array of all property values. Return value mixed[] An array of property values, keyed by property name. Overrides EntityInterface::toArray File core/lib/Drupal/Core/Entity/Entity.php, line 587 Class Entity Defines a base entity class. Namespace Drupal\Core\Entity Code public function toArray() { return array(); }