Drupal 8  8.0.2
ContentEntityInterface Interface Reference
Inheritance diagram for ContentEntityInterface:

Public Member Functions

 hasTranslationChanges ()
 
 setRevisionTranslationAffected ($affected)
 
 isRevisionTranslationAffected ()
 
- Public Member Functions inherited from FieldableEntityInterface
 hasField ($field_name)
 
 getFieldDefinition ($name)
 
 getFieldDefinitions ()
 
 toArray ()
 
 get ($field_name)
 
 set ($field_name, $value, $notify=TRUE)
 
 getFields ($include_computed=TRUE)
 
 getTranslatableFields ($include_computed=TRUE)
 
 onChange ($field_name)
 
 validate ()
 
 isValidationRequired ()
 
 setValidationRequired ($required)
 
- Public Member Functions inherited from EntityInterface
 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)
 
 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)
 
- Public Member Functions inherited from RevisionableInterface
 isNewRevision ()
 
 setNewRevision ($value=TRUE)
 
 getRevisionId ()
 
 isDefaultRevision ($new_value=NULL)
 
 preSaveRevision (EntityStorageInterface $storage,\stdClass $record)
 
- Public Member Functions inherited from TranslatableInterface
 language ()
 
 isDefaultTranslation ()
 
 isNewTranslation ()
 
 getTranslationLanguages ($include_default=TRUE)
 
 getTranslation ($langcode)
 
 getUntranslated ()
 
 hasTranslation ($langcode)
 
 addTranslation ($langcode, array $values=array())
 
 removeTranslation ($langcode)
 
 isTranslatable ()
 

Additional Inherited Members

- Static Public Member Functions inherited from FieldableEntityInterface
static baseFieldDefinitions (EntityTypeInterface $entity_type)
 
static bundleFieldDefinitions (EntityTypeInterface $entity_type, $bundle, array $base_field_definitions)
 
- Static Public Member Functions inherited from EntityInterface
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 content entity objects.

Content entities use fields for all their entity properties and are translatable and revisionable, while translations and revisions can be enabled per entity type. It's best practice to always implement ContentEntityInterface for content-like entities that should be stored in some database, and enable/disable revisions and translations as desired.

When implementing this interface which extends Traversable, make sure to list IteratorAggregate or Iterator before this interface in the implements clause.

See Also

Member Function Documentation

hasTranslationChanges ( )

Determines if the current translation of the entity has unsaved changes.

If the entity is translatable only translatable fields will be checked for changes.

Returns
bool TRUE if the current translation of the entity has changes.
isRevisionTranslationAffected ( )

Checks whether the current translation is affected by the current revision.

Returns
bool TRUE if the entity object is affected by the current revision, FALSE otherwise.

Implemented in ContentEntityBase.

setRevisionTranslationAffected (   $affected)

Marks the current revision translation as affected.

Parameters
bool | null$affectedThe flag value. A NULL value can be specified to reset the current value and make sure a new value will be computed by the system.
Returns
$this

Implemented in ContentEntityBase.


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