Drupal 8  8.0.2
EntityTestUpdate Class Reference
Inheritance diagram for EntityTestUpdate:

Static Public Member Functions

static baseFieldDefinitions (EntityTypeInterface $entity_type)
 
static bundleFieldDefinitions (EntityTypeInterface $entity_type, $bundle, array $base_field_definitions)
 
- Static Public Member Functions inherited from EntityTestRev
static baseFieldDefinitions (EntityTypeInterface $entity_type)
 
- Static Public Member Functions inherited from EntityTest
static preCreate (EntityStorageInterface $storage, array &$values)
 
static baseFieldDefinitions (EntityTypeInterface $entity_type)
 
- Static Public Member Functions inherited from ContentEntityBase
static bundleFieldDefinitions (EntityTypeInterface $entity_type, $bundle, array $base_field_definitions)
 
- Static Public Member Functions inherited from Entity
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 

Additional Inherited Members

- Public Member Functions inherited from EntityTest
 getOwner ()
 
 getOwnerId ()
 
 setOwnerId ($uid)
 
 setOwner (UserInterface $account)
 
 setName ($name)
 
 getName ()
 
- Public Member Functions inherited from ContentEntityBase
 __construct (array $values, $entity_type, $bundle=FALSE, $translations=array())
 
 postCreate (EntityStorageInterface $storage)
 
 setNewRevision ($value=TRUE)
 
 isNewRevision ()
 
 isDefaultRevision ($new_value=NULL)
 
 isRevisionTranslationAffected ()
 
 setRevisionTranslationAffected ($affected)
 
 isDefaultTranslation ()
 
 getRevisionId ()
 
 isTranslatable ()
 
 preSave (EntityStorageInterface $storage)
 
 preSaveRevision (EntityStorageInterface $storage,\stdClass $record)
 
 validate ()
 
 isValidationRequired ()
 
 setValidationRequired ($required)
 
 __sleep ()
 
 id ()
 
 bundle ()
 
 uuid ()
 
 hasField ($field_name)
 
 get ($field_name)
 
 set ($name, $value, $notify=TRUE)
 
 getFields ($include_computed=TRUE)
 
 getTranslatableFields ($include_computed=TRUE)
 
 getIterator ()
 
 getFieldDefinition ($name)
 
 getFieldDefinitions ()
 
 toArray ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 onChange ($name)
 
 getTranslation ($langcode)
 
 getUntranslated ()
 
 hasTranslation ($langcode)
 
 isNewTranslation ()
 
 removeTranslation ($langcode)
 
 getTranslationLanguages ($include_default=TRUE)
 
 updateOriginalValues ()
 
__get ($name)
 
 __set ($name, $value)
 
 __isset ($name)
 
 __unset ($name)
 
 createDuplicate ()
 
 __clone ()
 
 label ()
 
 referencedEntities ()
 
- Public Member Functions inherited from Entity
 __construct (array $values, $entity_type)
 
 id ()
 
 uuid ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=[])
 
 toUrl ($rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($rel)
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 url ($rel= 'canonical', $options=array())
 
 uriRelationships ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 save ()
 
 delete ()
 
 createDuplicate ()
 
 getEntityType ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 referencedEntities ()
 
 getCacheContexts ()
 
 getCacheTagsToInvalidate ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 __sleep ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- 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 ContentEntityInterface
 hasTranslationChanges ()
 
- Public Member Functions inherited from TranslatableInterface
 addTranslation ($langcode, array $values=array())
 
- Data Fields inherited from ContentEntityBase
const TRANSLATION_REMOVED = 0
 
const TRANSLATION_EXISTING = 1
 
const TRANSLATION_CREATED = 2
 
- Protected Member Functions inherited from ContentEntityBase
 getLanguages ()
 
 clearTranslationCache ()
 
 getTranslatedField ($name, $langcode)
 
 setDefaultLangcode ()
 
 updateFieldLangcodes ($langcode)
 
 initializeTranslation ($langcode)
 
 getEntityKey ($key)
 
- Protected Member Functions inherited from Entity
 entityManager ()
 
 entityTypeManager ()
 
 languageManager ()
 
 uuidGenerator ()
 
 linkTemplates ()
 
 urlRouteParameters ($rel)
 
 invalidateTagsOnSave ($update)
 
- Static Protected Member Functions inherited from Entity
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 
- Protected Attributes inherited from ContentEntityBase
 $values = array()
 
 $fields = array()
 
 $fieldDefinitions
 
 $languages
 
 $langcodeKey
 
 $defaultLangcodeKey
 
 $activeLangcode = LanguageInterface::LANGCODE_DEFAULT
 
 $defaultLangcode
 
 $translations = array()
 
 $translationInitialize = FALSE
 
 $newRevision = FALSE
 
 $isDefaultRevision = TRUE
 
 $entityKeys = array()
 
 $translatableEntityKeys = array()
 
 $validated = FALSE
 
 $validationRequired = FALSE
 
- Protected Attributes inherited from Entity
 $entityTypeId
 
 $enforceIsNew
 
 $typedData
 

Detailed Description

Defines the test entity class for testing definition updates.

This entity type starts out non-revisionable by lacking a "revision_id" key, but during an update test, can be made revisionable by adding that key.

( id = "entity_test_update", label = ("Test entity update"), handlers = { "storage_schema" = "Drupal\entity_test\EntityTestStorageSchema" }, base_table = "entity_test_update", revision_table = "entity_test_update_revision", persistent_cache = FALSE, entity_keys = { "id" = "id", "uuid" = "uuid", "bundle" = "type", "label" = "name", "langcode" = "langcode", } )

Member Function Documentation

static baseFieldDefinitions ( EntityTypeInterface  $entity_type)
static

{Provides base field definitions for an entity type.Implementations typically use the class for creating the field definitions; for example a 'name' field could be defined as the following:

$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'));
By definition, base fields are fields that exist for every bundle. To provide definitions for fields that should only exist on some bundles, use ::bundleFieldDefinitions().The definitions returned by this function can be overridden for all bundles by hook_entity_base_field_info_alter() or overridden on a per-bundle basis via 'base_field_override' configuration entities.
Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type definition. Useful when a single class is used for multiple, possibly dynamic entity types.
Returns
[] An array of base field definitions for the entity type, keyed by field name.
See Also
::getFieldDefinitions()
::bundleFieldDefinitions()
}

Implements FieldableEntityInterface.

References Drupal\state().

Referenced by EntityDefinitionUpdateTest\testLongNameFieldIndexes().

Here is the call graph for this function:

Here is the caller graph for this function:

static bundleFieldDefinitions ( EntityTypeInterface  $entity_type,
  $bundle,
array  $base_field_definitions 
)
static

{Provides field definitions for a specific bundle.This function can return definitions both for bundle fields (fields that are not defined in $base_field_definitions, and therefore might not exist on some bundles) as well as bundle-specific overrides of base fields (fields that are defined in $base_field_definitions, and therefore exist for all bundles). However, bundle-specific base field overrides can also be provided by 'base_field_override' configuration entities, and that is the recommended approach except in cases where an entity type needs to provide a bundle-specific base field override that is decoupled from configuration. Note that for most entity types, the bundles themselves are derived from configuration (e.g., 'node' bundles are managed via 'node_type' configuration entities), so decoupling bundle-specific base field overrides from configuration only makes sense for entity types that also decouple their bundles from configuration. In cases where both this function returns a bundle-specific override of a base field and a 'base_field_override' configuration entity exists, the latter takes precedence.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type definition. Useful when a single class is used for multiple, possibly dynamic entity types.
string$bundleThe bundle.
\Drupal\Core\Field\FieldDefinitionInterface[]$base_field_definitions The list of base field definitions.
Returns
[] An array of bundle field definitions, keyed by field name.
See Also
::getFieldDefinitions()
::baseFieldDefinitions()
Todo:
WARNING: This method will be changed in https://www.drupal.org/node/2346347.
}

Implements FieldableEntityInterface.

References Drupal\state().

Here is the call graph for this function:


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