Drupal 8  8.0.2
EntityInterface Interface Reference
Inheritance diagram for EntityInterface:

Public Member Functions

 uuid ()
 
 id ()
 
 language ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=array())
 
 toUrl ($rel= 'canonical', array $options=array())
 
 url ($rel= 'canonical', $options=array())
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($key)
 
 uriRelationships ()
 
 save ()
 
 delete ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 createDuplicate ()
 
 getEntityType ()
 
 referencedEntities ()
 
 getOriginalId ()
 
 getCacheTagsToInvalidate ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from AccessibleInterface
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
- Public Member Functions inherited from CacheableDependencyInterface
 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 

Static Public Member Functions

static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 

Detailed Description

Defines a common interface for all entity objects.

Member Function Documentation

bundle ( )

Gets the bundle of the entity.

Returns
string The bundle of the entity. Defaults to the entity type ID if the entity type does not make use of different bundles.

Implemented in ViewUI, ContentEntityBase, and Entity.

Referenced by NodePreviewAccessCheck\access(), NodeRevisionAccessCheck\checkAccess(), ForumManager\checkNodeType(), EntityFormDisplay\collectRenderDisplay(), EntityViewDisplay\collectRenderDisplay(), EntityAdapter\createFromEntity(), SqlContentEntityStorage\deleteFromDedicatedTables(), SqlContentEntityStorage\deleteRevisionFromDedicatedTables(), BlockContentTranslationHandler\entityFormTitle(), DefaultLanguageItem\getDefaultLangcode(), QuickEditFieldForm\init(), SqlContentEntityStorage\saveToDedicatedTables(), and Entity\validateEntity().

Here is the caller graph for this function:

static create ( array  $values = array())
static

Constructs a new entity object, without permanently saving it.

Parameters
array$values(optional) An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.
Returns
static The entity object.

Implemented in ViewUI, and Entity.

createDuplicate ( )

Creates a duplicate of the entity.

Returns
static A clone of $this with all identifiers unset, so saving it inserts a new entity into the storage system.

Implemented in ContentEntityBase, ViewUI, Entity, ConfigEntityBase, View, and BlockContent.

delete ( )

Deletes an entity permanently.

Exceptions
\Drupal\Core\Entity\EntityStorageExceptionIn case of failures an exception is thrown.

Implemented in ViewUI, Entity, and BlockContent.

Referenced by ShortcutController\deleteShortcutLinkInline().

Here is the caller graph for this function:

enforceIsNew (   $value = TRUE)

Enforces an entity to be new.

Allows migrations to create entities with pre-defined IDs by forcing the entity to be new before saving.

Parameters
bool$value(optional) Whether the entity should be forced to be new. Defaults to TRUE.
Returns
$this
See Also
::isNew()

Implemented in ViewUI, and Entity.

Referenced by EntityStorageBase\doPostSave(), and UserStorage\doSaveFieldItems().

Here is the caller graph for this function:

getCacheTagsToInvalidate ( )

Returns the cache tags that should be used to invalidate caches.

This will not return additional cache tags added through addCacheTags().

Returns
string[] Set of cache tags.
See Also
::addCacheTags()
::getCacheTags()

Implemented in ViewUI, Entity, ConfigEntityBase, Item, Shortcut, and DateFormat.

getConfigDependencyKey ( )

Gets the key that is used to store configuration dependencies.

Returns
string The key to be used in configuration dependencies when storing dependencies on entities of this type.
See Also
::getConfigDependencyKey()

Implemented in ViewUI, and Entity.

getConfigDependencyName ( )

Gets the configuration dependency name.

Configuration entities can depend on content and configuration entities. They store an array of content and config dependency names in their "dependencies" key.

Returns
string The configuration dependency name.
See Also

Implemented in ViewUI, Entity, and ConfigEntityBase.

Referenced by ConfigManager\callOnDependencyRemoval(), and EntityDeleteForm\getConfigNamesToDelete().

Here is the caller graph for this function:

getConfigTarget ( )

Gets the configuration target identifier for the entity.

Used to supply the correct format for storing a reference targeting this entity in configuration.

Returns
string The configuration target identifier.

Implemented in ViewUI, Entity, and ConfigEntityBase.

getEntityType ( )

Gets the entity type definition.

Returns
The entity type definition.

Implemented in ViewUI, and Entity.

Referenced by BookExport\bookExportHtml(), ContentTranslationHandler\getTranslationAccess(), ContentTranslationManager\getTranslationMetadata(), and ContentEntityForm\updateChangedTime().

Here is the caller graph for this function:

getOriginalId ( )

Gets the original ID.

Returns
int|string|null The original ID, or NULL if no ID was set or for entity types that do not support renames.

Implemented in ViewUI, Entity, and ConfigEntityBase.

Referenced by EntityStorageBase\doPreSave(), ImageStyle\replaceImageStyle(), ConfigEntityStorageTest\testSaveRename(), and KeyValueEntityStorageTest\testSaveRenameConfigEntity().

Here is the caller graph for this function:

getTypedData ( )

Gets a typed data object for this entity object.

The returned typed data object wraps this entity and allows dealing with entities based on the generic typed data API.

Returns
The typed data object for this entity.
See Also

Implemented in ViewUI, and Entity.

Referenced by FieldTypePluginManager\createFieldItemList().

Here is the caller graph for this function:

hasLinkTemplate (   $key)

Indicates if a link template exists for a given key.

Parameters
string$keyThe link type.
Returns
bool TRUE if the link template exists, FALSE otherwise.

Implemented in ViewUI, and Entity.

Referenced by RoleListBuilder\getDefaultOperations(), EntityListBuilder\getDefaultOperations(), ViewListBuilder\getDefaultOperations(), and ContentEntityNormalizer\getEntityUri().

Here is the caller graph for this function:

id ( )

Gets the identifier.

Returns
string|int|null The entity identifier, or NULL if the object does not yet have an identifier.

Implemented in ViewUI, ContentEntityBase, FieldStorageConfig, EntityDisplayBase, FieldConfigBase, RdfMapping, FilterFormat, Entity, Vocabulary, NodeType, ImageStyle, ContentLanguageSettings, and Editor.

Referenced by NodeGrantDatabaseStorage\access(), DatabaseFileUsageBackend\add(), NodeController\add(), ShortcutController\addForm(), TaxonomyController\addForm(), BlockContentController\addForm(), BookManager\addFormElements(), MenuController\addLink(), ShortcutSetController\addShortcutLinkInline(), TermViewBuilder\alterBuild(), BlockContentViewBuilder\alterBuild(), EntityDisplayTest\assertDependencyHelper(), FileManagedTestBase\assertDifferentFile(), FileManagedUnitTestBase\assertDifferentFile(), FieldTestBase\assertFieldValues(), FieldUnitTestBase\assertFieldValues(), FileManagedTestBase\assertFileUnchanged(), FileManagedUnitTestBase\assertFileUnchanged(), FileManagedTestBase\assertSameFile(), FileManagedUnitTestBase\assertSameFile(), ShortcutSetStorage\assignUser(), ForumController\build(), CommentLazyBuilders\buildLinks(), ResponsiveImageStyleListBuilder\buildRow(), ConfigTestListBuilder\buildRow(), EntityTestListBuilder\buildRow(), ContactFormListBuilder\buildRow(), ViewListBuilder\buildRow(), LanguageListBuilder\buildRow(), ContactFormAccessControlHandler\checkAccess(), RoleAccessControlHandler\checkAccess(), NodeRevisionAccessCheck\checkAccess(), BulkDeleteTest\checkHooksInvocations(), BookManager\checkNodeIsRemovable(), NodeEditFormTest\checkVariousAuthoredByValues(), ShortcutSetStorage\countAssignedUsers(), NodeStorage\countDefaultLanguageRevisions(), ForumIndexStorage\create(), ForumIndexStorage\createIndex(), ShortcutSetStorage\deleteAssignedShortcutSets(), CommentTestBase\deleteComment(), AggregatorTestBase\deleteFeed(), AggregatorTestBase\deleteFeedItems(), SqlContentEntityStorage\deleteFromDedicatedTables(), ForumIndexStorage\deleteIndex(), ForumIndexStorage\deleteRevision(), SqlContentEntityStorage\deleteRevisionFromDedicatedTables(), ImageStyleDownloadController\deliver(), EntityStorageBase\doPostSave(), EntityStorageBase\doPreSave(), KeyValueEntityStorage\doSave(), ConfigEntityStorage\doSave(), UserStorage\doSaveFieldItems(), QuickEditController\entitySave(), FieldUnitTestBase\entitySaveReload(), ForumController\forumPage(), EntityViewBuilder\getBuildDefaults(), VocabularyListBuilder\getDefaultOperations(), CommentStorage\getDisplayOrdinal(), ImageAdminStylesTest\getImageCount(), ItemStorage\getItemCount(), ForumIndexStorage\getOriginalTermId(), ForumUninstallValidator\hasTermsForVocabulary(), hook_comment_links_alter(), hook_migrate_prepare_row(), NodeSearch\indexNode(), DatabaseFileUsageBackend\listUsage(), EntityResource\patch(), CommentTestBase\performCommentOperation(), DefaultProcessor\postProcess(), DefaultProcessor\process(), SqlContentEntityStorage\purgeFieldItems(), HistoryController\readNode(), SearchController\redirectSearchPage(), ImageStyle\replaceImageStyle(), NodeStorage\revisionIds(), EntityContentBase\save(), KeyValueEntityStorage\save(), ConfigEntityStorage\save(), ContentTranslationSyncImageTest\saveEntity(), SqlContentEntityStorage\saveToDedicatedTables(), SqlContentEntityStorage\saveToSharedTables(), SearchPageRepository\setDefaultSearchPage(), ConfigEntityStorageTest\testSaveRename(), ConfigEntityStorageTest\testSaveUpdate(), AggregatorTestBase\updateAndDelete(), AggregatorTestBase\updateFeedItems(), ForumIndexStorage\updateIndex(), BookManager\updateOutline(), TermStorage\updateTermHierarchy(), EntityTestViewBuilderOverriddenView\view(), and NodeGrantDatabaseStorage\write().

isNew ( )

Determines whether the entity is new.

Usually an entity is new if no ID exists for it yet. However, entities may be enforced to be new with existing IDs too.

Returns
bool TRUE if the entity is new, or FALSE if the entity has already been saved.
See Also
::enforceIsNew()

Implemented in ViewUI, ConfigEntityBase, Entity, and User.

Referenced by NodePreviewAccessCheck\access(), BookManager\addFormElements(), BlockContentViewBuilder\alterBuild(), EntityAccessControlHandler\checkAccess(), ForumIndexStorage\createIndex(), EntityStorageBase\doPreSave(), KeyValueEntityStorage\doSave(), ConfigEntityStorage\doSave(), SqlContentEntityStorage\doSaveFieldItems(), EntityViewBuilder\getBuildDefaults(), ContentEntityNormalizer\getEntityUri(), SqlContentEntityStorage\has(), and EntityStorageBase\save().

Here is the caller graph for this function:

label ( )

Gets the label of the entity.

Returns
string|null The label of the entity, or NULL if there is no label defined.

Implemented in ContentEntityBase, ViewUI, Block, Entity, View, Editor, Feed, Item, and EntityTestNoLabel.

Referenced by BookManager\addFormElements(), NodeController\addPageTitle(), BookExport\bookExportHtml(), NodeViewBuilder\buildLinks(), ResponsiveImageStyleListBuilder\buildRow(), BlockContentListBuilder\buildRow(), ConfigTestListBuilder\buildRow(), EntityTestListBuilder\buildRow(), ContactFormListBuilder\buildRow(), MenuListBuilder\buildRow(), RoleListBuilder\buildRow(), ConfigTranslationBlockListBuilder\buildRow(), ImageStyleListBuilder\buildRow(), ConfigTranslationEntityListBuilder\buildRow(), VocabularyListBuilder\buildRow(), EntityDisplayModeListBuilder\buildRow(), DraggableListBuilder\buildRow(), ActionListBuilder\buildRow(), LanguageListBuilder\buildRow(), ConfigTranslationFieldListBuilder\buildRow(), AggregatorTestBase\deleteFeed(), AggregatorTestBase\deleteFeedItems(), ShortcutController\deleteShortcutLinkInline(), SearchController\editTitle(), ContentTranslationHandler\entityFormAlter(), BlockContentTranslationHandler\entityFormTitle(), ContentTranslationHandler\entityFormTitle(), AggregatorController\feedRefresh(), AggregatorController\feedTitle(), TestFetcher\fetch(), MetadataGenerator\generateEntityMetadata(), BlockContentController\getAddFormTitle(), FilterController\getLabel(), EntityListBuilder\getLabel(), FieldConfigEditForm\getTitle(), NodeSearch\indexNode(), MenuController\menuTitle(), DefaultParser\parse(), SearchController\performOperation(), ItemsImporter\refresh(), SearchController\setAsDefault(), DateFormat\sort(), Block\sort(), ConfigEntityBase\sort(), LanguageTestController\testEntity(), EntityTestViewBuilderOverriddenView\view(), SearchController\view(), and TaxonomyController\vocabularyTitle().

Here is the caller graph for this function:

language ( )

Gets the language of the entity.

Returns
The language object.

Implemented in ViewUI, ContentEntityBase, and Entity.

Referenced by EntityAccessControlHandler\access(), ContentTranslationHandler\entityFormAlter(), EntityViewBuilder\getBuildDefaults(), EntityRepository\getTranslationFromContext(), ContentTranslationHandler\retranslate(), and ContentEntityForm\updateFormLangcode().

Here is the caller graph for this function:

link (   $text = NULL,
  $rel = 'canonical',
array  $options = [] 
)

Deprecated way of generating a link to the entity. See toLink().

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$optionsSee ::generateFromRoute() for the available options.
Returns
string An HTML string containing a link to the entity.
Deprecated:
in Drupal 8.0.0, intended to be removed in Drupal 9.0.0 Please use toLink() instead.
See Also
::toLink

Implemented in ViewUI, ConfigEntityBase, and Entity.

Referenced by ContactFormListBuilder\buildRow(), BlockContentTypeListBuilder\buildRow(), and DefaultProcessor\process().

Here is the caller graph for this function:

static load (   $id)
static

Loads an entity.

Parameters
mixed$idThe id of the entity to load.
Returns
static The entity object or NULL if there is no entity with the given ID.

Implemented in ViewUI, and Entity.

Referenced by NodeEditFormTest\checkVariousAuthoredByValues().

Here is the caller graph for this function:

static loadMultiple ( array  $ids = NULL)
static

Loads one or more entities.

Parameters
array$idsAn array of entity IDs, or NULL to load all entities.
Returns
static[] An array of entity objects indexed by their IDs.

Implemented in ViewUI, and Entity.

postCreate ( EntityStorageInterface  $storage)

Acts on an entity after it is created but before hooks are invoked.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.

Implemented in ViewUI, Entity, View, FieldConfigBase, ContentEntityBase, and FieldConfig.

static postDelete ( EntityStorageInterface  $storage,
array  $entities 
)
static

Acts on deleted entities before the delete hook is invoked.

Used after the entities are deleted but before invoking the delete hook.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
\Drupal\Core\Entity\EntityInterface[]$entities An array of entities.

Implemented in ViewUI, Entity, FieldStorageConfig, View, FieldConfig, ConfigurableLanguage, Vocabulary, User, ImageStyle, ConfigTest, Term, and ConfigEntityBundleBase.

static postLoad ( EntityStorageInterface  $storage,
array &  $entities 
)
static

Acts on loaded entities.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
\Drupal\Core\Entity\EntityInterface[]$entities An array of entities.

Implemented in SqlContentEntityStorageTestEntityInterface, ViewUI, Entity, View, and Role.

postSave ( EntityStorageInterface  $storage,
  $update = TRUE 
)

Acts on a saved entity before the insert or update hook is invoked.

Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
bool$updateTRUE if the entity has been updated, or FALSE if it has been inserted.

Implemented in ViewUI, Entity, FieldStorageConfig, View, FieldConfigBase, Block, EntityViewDisplay, RdfMapping, ConfigurableLanguage, BlockContent, ImageStyle, User, Term, ConfigTest, and ConfigEntityBundleBase.

Referenced by EntityStorageBase\doPostSave().

Here is the caller graph for this function:

static preCreate ( EntityStorageInterface  $storage,
array &  $values 
)
static

Changes the values of an entity before it is created.

Load defaults for example.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
mixed[]$values An array of values to set, keyed by property name. If the entity type has bundles the bundle key has to be specified.

Implemented in ViewUI, Entity, View, MenuLinkContent, and EntityTest.

static preDelete ( EntityStorageInterface  $storage,
array  $entities 
)
static

Acts on entities before they are deleted and before hooks are invoked.

Used before the entities are deleted and before invoking the delete hook.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
\Drupal\Core\Entity\EntityInterface[]$entities An array of entities.

Implemented in ViewUI, Entity, FieldStorageConfig, FieldConfig, ConfigurableLanguage, Vocabulary, and EntityDisplayModeBase.

preSave ( EntityStorageInterface  $storage)

Acts on an entity before the presave hook is invoked.

Used before the entity is saved and before invoking the presave hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed. This is different from its counterpart in the Field API, FieldItemListInterface::preSave(), which is fired on all field translations automatically.

Todo:
Adjust existing implementations and the documentation according to https://www.drupal.org/node/2577609 to have a consistent API.
Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
See Also
::preSave()

Implemented in ViewUI, Entity, ContentEntityBase, ConfigEntityBase, View, FieldStorageConfig, MenuLinkContent, Role, BaseFieldOverride, ContentLanguageSettings, FieldConfig, ConfigurableLanguage, EntityDisplayModeBase, ConfigEntityBundleBase, and User.

Referenced by EntityStorageBase\doPreSave().

Here is the caller graph for this function:

referencedEntities ( )

Gets a list of entities referenced by this entity.

Returns
[] An array of entities.

Implemented in ViewUI, ContentEntityBase, Entity, and Comment.

save ( )

Saves an entity permanently.

When saving existing entities, the entity is assumed to be complete, partial updates of entities are not supported.

Returns
int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.
Exceptions
\Drupal\Core\Entity\EntityStorageExceptionIn case of failures an exception is thrown.

Implemented in ViewUI, ConfigEntityBase, Entity, and EntityTestMulChanged.

Referenced by FileUsageBase\add(), ViewsUIController\ajaxOperation(), CommentController\commentApprove(), NodeRevisionsTest\createRevisions(), FieldUnitTestBase\entitySaveReload(), FieldUnitTestBase\entityValidateAndSave(), EntityResource\patch(), SearchController\performOperation(), TestProcessor\postProcess(), ItemsImporter\refresh(), EntityRevision\save(), EntityContentBase\save(), CommentAttributesTest\saveComment(), and ContentTranslationSyncImageTest\saveEntity().

Here is the caller graph for this function:

setOriginalId (   $id)

Sets the original ID.

Parameters
int | string | null$idThe new ID to set as original ID. If the entity supports renames, setting NULL will prevent an update from being considered a rename.
Returns
$this

Implemented in ViewUI, Entity, and ConfigEntityBase.

Referenced by EntityStorageBase\doPostSave().

Here is the caller graph for this function:

toArray ( )

Gets an array of all property values.

Returns
mixed[] An array of property values, keyed by property name.

Implemented in ViewUI, Entity, ContentEntityBase, EntityDisplayBase, FilterFormat, and FieldableEntityInterface.

Referenced by KeyValueEntityStorage\doSave(), ContentTranslationUITestBase\getFormSubmitActionForNewTranslation(), and ConfigEntityStorage\mapToStorageRecord().

Here is the caller graph for this function:

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$optionsSee ::generateFromRoute() for the available options.
Returns
A Link to the entity.
Exceptions
\Drupal\Core\Entity\EntityMalformedException
\Drupal\Core\Entity\Exception\UndefinedLinkTemplateException

Implemented in ViewUI, and Entity.

toUrl (   $rel = 'canonical',
array  $options = array() 
)

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 the links array, the uri_callback function is used for setting the path. If this does not exist and the link relationship type is canonical, the path is set using the default template: entity/entityType/id.

Parameters
string$relThe link relationship type, for example: canonical or edit-form.
array$optionsSee ::generateFromRoute() for the available options.
Returns
The URL object.
Exceptions
\Drupal\Core\Entity\EntityMalformedException
\Drupal\Core\Entity\Exception\UndefinedLinkTemplateException

Implemented in ViewUI, ConfigEntityBase, and Entity.

Referenced by EntityUrlTest\getTestToUrl().

Here is the caller graph for this function:

uriRelationships ( )

Gets a list of URI relationships supported by this entity.

Returns
string[] An array of link relationships supported by this entity.

Implemented in ViewUI, and Entity.

url (   $rel = 'canonical',
  $options = array() 
)

Gets the public URL for this entity.

Parameters
string$relThe link relationship type, for example: canonical or edit-form.
array$optionsSee ::generateFromRoute() for the available options.
Returns
string The URL for this entity.
Deprecated:
in Drupal 8.0.0, intended to be removed in Drupal 9.0.0 Please use toUrl() instead.
See Also
::toUrl

Implemented in ViewUI, ConfigEntityBase, Entity, and File.

Referenced by CommentAttributesTest\_testBasicCommentRdfaMarkup(), StandardProfileTest\assertRdfaCommonNodeProperties(), BlockContentListBuilder\getDefaultOperations(), ContentEntityNormalizer\getEntityUri(), and DefaultProcessor\process().

Here is the caller graph for this function:

urlInfo (   $rel = 'canonical',
array  $options = array() 
)

Gets the URL object for the entity.

Parameters
string$relThe link relationship type, for example: canonical or edit-form.
array$optionsSee ::generateFromRoute() for the available options.
Returns
The URL object.
Deprecated:
in Drupal 8.0.0, intended to be removed in Drupal 9.0.0 Use ::toUrl() instead.
See Also
::toUrl

Implemented in ViewUI, ConfigEntityBase, and Entity.

Referenced by NodeViewBuilder\buildLinks(), CommentLazyBuilders\buildLinks(), VocabularyListBuilder\getDefaultOperations(), ResponsiveImageStyleListBuilder\getDefaultOperations(), RoleListBuilder\getDefaultOperations(), MenuListBuilder\getDefaultOperations(), ImageStyleListBuilder\getDefaultOperations(), EntityListBuilder\getDefaultOperations(), ViewListBuilder\getDefaultOperations(), NormalizeTest\getEntityUri(), ContentEntityNormalizer\getEntityUri(), EntityUrlTest\getTestUrlInfo(), and SearchController\performOperation().

Here is the caller graph for this function:

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.

Returns
string|null The UUID of the entity, or NULL if the entity does not have one.

Implemented in ViewUI, ContentEntityBase, and Entity.

Referenced by EntityAccessControlHandler\access(), CreateTest\assertReadEntityIdFromHeaderAndDb(), QuickEditController\entitySave(), field_purge_field(), field_purge_field_storage(), QuickEditController\fieldForm(), and EntityReferenceFieldItemList\processDefaultValue().

Here is the caller graph for this function:


The documentation for this interface was generated from the following file: