Drupal 8  8.0.2
TermStorage Class Reference
Inheritance diagram for TermStorage:

Public Member Functions

 create (array $values=array())
 
 resetCache (array $ids=NULL)
 
 deleteTermHierarchy ($tids)
 
 updateTermHierarchy (EntityInterface $term)
 
 loadParents ($tid)
 
 loadAllParents ($tid)
 
 loadChildren ($tid, $vid=NULL)
 
 loadTree ($vid, $parent=0, $max_depth=NULL, $load_entities=FALSE)
 
 nodeCount ($vid)
 
 resetWeights ($vid)
 
 getNodeTerms (array $nids, array $vocabs=array(), $langcode=NULL)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from SqlContentEntityStorage
 getFieldStorageDefinitions ()
 
 __construct (EntityTypeInterface $entity_type, Connection $database, EntityManagerInterface $entity_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager)
 
 getBaseTable ()
 
 getRevisionTable ()
 
 getDataTable ()
 
 getRevisionDataTable ()
 
 setEntityType (EntityTypeInterface $entity_type)
 
 getTableMapping (array $storage_definitions=NULL)
 
 delete (array $entities)
 
 save (EntityInterface $entity)
 
 requiresEntityStorageSchemaChanges (EntityTypeInterface $entity_type, EntityTypeInterface $original)
 
 requiresFieldStorageSchemaChanges (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 requiresEntityDataMigration (EntityTypeInterface $entity_type, EntityTypeInterface $original)
 
 requiresFieldDataMigration (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 onEntityTypeCreate (EntityTypeInterface $entity_type)
 
 onEntityTypeUpdate (EntityTypeInterface $entity_type, EntityTypeInterface $original)
 
 onEntityTypeDelete (EntityTypeInterface $entity_type)
 
 onFieldStorageDefinitionCreate (FieldStorageDefinitionInterface $storage_definition)
 
 onFieldStorageDefinitionUpdate (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 onFieldStorageDefinitionDelete (FieldStorageDefinitionInterface $storage_definition)
 
 onFieldDefinitionDelete (FieldDefinitionInterface $field_definition)
 
 onBundleCreate ($bundle, $entity_type_id)
 
 onBundleDelete ($bundle, $entity_type_id)
 
 finalizePurge (FieldStorageDefinitionInterface $storage_definition)
 
 countFieldData ($storage_definition, $as_bool=FALSE)
 
- Public Member Functions inherited from ContentEntityStorageBase
 __construct (EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, CacheBackendInterface $cache)
 
 hasData ()
 
 createTranslation (ContentEntityInterface $entity, $langcode, array $values=[])
 
 onFieldStorageDefinitionCreate (FieldStorageDefinitionInterface $storage_definition)
 
 onFieldStorageDefinitionUpdate (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 onFieldStorageDefinitionDelete (FieldStorageDefinitionInterface $storage_definition)
 
 onFieldDefinitionCreate (FieldDefinitionInterface $field_definition)
 
 onFieldDefinitionUpdate (FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original)
 
 onFieldDefinitionDelete (FieldDefinitionInterface $field_definition)
 
 purgeFieldData (FieldDefinitionInterface $field_definition, $batch_size)
 
 finalizePurge (FieldStorageDefinitionInterface $storage_definition)
 
 loadRevision ($revision_id)
 
 resetCache (array $ids=NULL)
 
- Public Member Functions inherited from EntityStorageBase
 __construct (EntityTypeInterface $entity_type)
 
 getEntityTypeId ()
 
 getEntityType ()
 
 loadUnchanged ($id)
 
 resetCache (array $ids=NULL)
 
 create (array $values=array())
 
 load ($id)
 
 loadMultiple (array $ids=NULL)
 
 delete (array $entities)
 
 save (EntityInterface $entity)
 
 loadByProperties (array $values=array())
 
 getQuery ($conjunction= 'AND')
 
 getAggregateQuery ($conjunction= 'AND')
 
- Public Member Functions inherited from EntityHandlerBase
 setModuleHandler (ModuleHandlerInterface $module_handler)
 
- Public Member Functions inherited from EntityStorageInterface
 deleteRevision ($revision_id)
 

Protected Attributes

 $parents = array()
 
 $parentsAll = array()
 
 $children = array()
 
 $treeParents = array()
 
 $treeChildren = array()
 
 $treeTerms = array()
 
 $trees = array()
 
- Protected Attributes inherited from SqlContentEntityStorage
 $tableMapping
 
 $revisionKey = FALSE
 
 $langcodeKey = FALSE
 
 $defaultLangcodeKey = FALSE
 
 $baseTable
 
 $revisionTable
 
 $dataTable
 
 $revisionDataTable
 
 $database
 
 $storageSchema
 
 $languageManager
 
- Protected Attributes inherited from ContentEntityStorageBase
 $bundleKey = FALSE
 
 $entityManager
 
 $cacheBackend
 
- Protected Attributes inherited from EntityStorageBase
 $entities = array()
 
 $entityTypeId
 
 $entityType
 
 $idKey
 
 $uuidKey
 
 $langcodeKey
 
 $uuidService
 
 $entityClass
 
- Protected Attributes inherited from EntityHandlerBase
 $moduleHandler
 

Additional Inherited Members

- Static Public Member Functions inherited from SqlContentEntityStorage
static createInstance (ContainerInterface $container, EntityTypeInterface $entity_type)
 
- Static Public Member Functions inherited from ContentEntityStorageBase
static createInstance (ContainerInterface $container, EntityTypeInterface $entity_type)
 
- Data Fields inherited from EntityStorageInterface
const FIELD_LOAD_CURRENT = 'FIELD_LOAD_CURRENT'
 
const FIELD_LOAD_REVISION = 'FIELD_LOAD_REVISION'
 
- Protected Member Functions inherited from SqlContentEntityStorage
 initTableLayout ()
 
 getStorageSchema ()
 
 doLoadMultiple (array $ids=NULL)
 
 getFromStorage (array $ids=NULL)
 
 mapFromStorageRecords (array $records, $load_from_revision=FALSE)
 
 loadFromSharedTables (array &$values, array &$translations)
 
 doLoadRevisionFieldItems ($revision_id)
 
 doDeleteRevisionFieldItems (ContentEntityInterface $revision)
 
 buildPropertyQuery (QueryInterface $entity_query, array $values)
 
 buildQuery ($ids, $revision_id=FALSE)
 
 doDeleteFieldItems ($entities)
 
 doSaveFieldItems (ContentEntityInterface $entity, array $names=[])
 
 has ($id, EntityInterface $entity)
 
 saveToSharedTables (ContentEntityInterface $entity, $table_name=NULL, $new_revision=NULL)
 
 mapToStorageRecord (ContentEntityInterface $entity, $table_name=NULL)
 
 isColumnSerial ($table_name, $schema_name)
 
 mapToDataStorageRecord (EntityInterface $entity, $table_name=NULL)
 
 saveRevision (ContentEntityInterface $entity)
 
 getQueryServiceName ()
 
 loadFromDedicatedTables (array &$values, $load_from_revision)
 
 saveToDedicatedTables (ContentEntityInterface $entity, $update=TRUE, $names=array())
 
 deleteFromDedicatedTables (ContentEntityInterface $entity)
 
 deleteRevisionFromDedicatedTables (ContentEntityInterface $entity)
 
 wrapSchemaException (callable $callback)
 
 readFieldItemsToPurge (FieldDefinitionInterface $field_definition, $batch_size)
 
 purgeFieldItems (ContentEntityInterface $entity, FieldDefinitionInterface $field_definition)
 
 storageDefinitionIsDeleted (FieldStorageDefinitionInterface $storage_definition)
 
- Protected Member Functions inherited from ContentEntityStorageBase
 doCreate (array $values)
 
 initFieldValues (ContentEntityInterface $entity, array $values=[], array $field_names=[])
 
 readFieldItemsToPurge (FieldDefinitionInterface $field_definition, $batch_size)
 
 purgeFieldItems (ContentEntityInterface $entity, FieldDefinitionInterface $field_definition)
 
 doLoadRevisionFieldItems ($revision_id)
 
 doSaveFieldItems (ContentEntityInterface $entity, array $names=[])
 
 doDeleteFieldItems ($entities)
 
 doDeleteRevisionFieldItems (ContentEntityInterface $revision)
 
 invokeTranslationHooks (ContentEntityInterface $entity)
 
 invokeStorageLoadHook (array &$entities)
 
 invokeFieldMethod ($method, ContentEntityInterface $entity)
 
 invokeFieldPostSave (ContentEntityInterface $entity, $update)
 
 hasFieldValueChanged (FieldDefinitionInterface $field_definition, ContentEntityInterface $entity, ContentEntityInterface $original)
 
 populateAffectedRevisionTranslations (ContentEntityInterface $entity)
 
 cleanIds (array $ids)
 
 getFromPersistentCache (array &$ids=NULL)
 
 setPersistentCache ($entities)
 
 buildCacheId ($id)
 
- Protected Member Functions inherited from EntityStorageBase
 getFromStaticCache (array $ids)
 
 setStaticCache (array $entities)
 
 invokeHook ($hook, EntityInterface $entity)
 
 doCreate (array $values)
 
 doLoadMultiple (array $ids=NULL)
 
 postLoad (array &$entities)
 
 mapFromStorageRecords (array $records)
 
 has ($id, EntityInterface $entity)
 
 doDelete ($entities)
 
 doPreSave (EntityInterface $entity)
 
 doSave ($id, EntityInterface $entity)
 
 doPostSave (EntityInterface $entity, $update)
 
 buildPropertyQuery (QueryInterface $entity_query, array $values)
 
 getQueryServiceName ()
 
- Protected Member Functions inherited from EntityHandlerBase
 moduleHandler ()
 

Detailed Description

Defines a Controller class for taxonomy terms.

Member Function Documentation

__sleep ( )

{}

__wakeup ( )

{}

create ( array  $values = array())

{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
A new entity object.
}

Parameters
array$valuesAn array of values to set, keyed by property name. A value for the vocabulary ID ('vid') is required.

Implements EntityStorageInterface.

deleteTermHierarchy (   $tids)

{Removed reference to terms from term_hierarchy.

Parameters
array$tidsArray of terms that need to be removed from hierarchy.
}

Implements TermStorageInterface.

References Drupal\database().

Here is the call graph for this function:

getNodeTerms ( array  $nids,
array  $vocabs = array(),
  $langcode = NULL 
)

{Returns all terms used to tag some given nodes.

Parameters
array$nidsNode IDs to retrieve terms for.
array$vocabs(optional) A vocabularies array to restrict the term search. Defaults to empty array.
string$langcode(optional) A language code to restrict the term search. Defaults to NULL.
Returns
array An array of nids and the term entities they were tagged with.
}

Implements TermStorageInterface.

References db_select(), and EntityStorageBase\loadMultiple().

Here is the call graph for this function:

loadAllParents (   $tid)

{Finds all ancestors of a given term ID.

Parameters
int$tidTerm ID to retrieve ancestors for.
Returns
[] An array of term objects which are the ancestors of the term $tid.
}

Implements TermStorageInterface.

References EntityStorageBase\load(), and TermStorage\loadParents().

Here is the call graph for this function:

loadChildren (   $tid,
  $vid = NULL 
)

{Finds all children of a term ID.

Parameters
int$tidTerm ID to retrieve parents for.
string$vidAn optional vocabulary ID to restrict the child search.
Returns
[] An array of term objects that are the children of the term $tid.
}

Implements TermStorageInterface.

References Drupal\database(), and EntityStorageBase\loadMultiple().

Here is the call graph for this function:

loadParents (   $tid)

{Finds all parents of a given term ID.

Parameters
int$tidTerm ID to retrieve parents for.
Returns
[] An array of term objects which are the parents of the term $tid.
}

Implements TermStorageInterface.

References Drupal\database(), and EntityStorageBase\loadMultiple().

Referenced by TermStorage\loadAllParents().

Here is the call graph for this function:

Here is the caller graph for this function:

loadTree (   $vid,
  $parent = 0,
  $max_depth = NULL,
  $load_entities = FALSE 
)

{Finds all terms in a given vocabulary ID.

Parameters
string$vidVocabulary ID to retrieve terms for.
int$parentThe term ID under which to generate the tree. If 0, generate the tree for the entire vocabulary.
int$max_depthThe number of levels of the tree to return. Leave NULL to return all levels.
bool$load_entitiesIf TRUE, a full entity load will occur on the term objects. Otherwise they are partial objects queried directly from the {taxonomy_term_data} table to save execution time and memory consumption when listing large numbers of terms. Defaults to FALSE.
Returns
[] An array of term objects that are the children of the vocabulary $vid.
}

Implements TermStorageInterface.

References Drupal\database(), and EntityStorageBase\loadMultiple().

Here is the call graph for this function:

nodeCount (   $vid)

{Count the number of nodes in a given vocabulary ID.

Parameters
string$vidVocabulary ID to retrieve terms for.
Returns
int A count of the nodes in a given vocabulary ID.
}

Implements TermStorageInterface.

References Drupal\database().

Here is the call graph for this function:

resetCache ( array  $ids = NULL)

{Resets the internal, static entity cache.

Parameters
$ids(optional) If specified, the cache is reset for the entities with the given ids only.
}

Implements EntityStorageInterface.

resetWeights (   $vid)

{Reset the weights for a given vocabulary ID.

Parameters
string$vidVocabulary ID to retrieve terms for.
}

Implements TermStorageInterface.

References Drupal\database().

Here is the call graph for this function:

updateTermHierarchy ( EntityInterface  $term)

{Updates terms hierarchy information with the hierarchy trail of it.

Parameters
\Drupal\Core\Entity\EntityInterface$termTerm entity that needs to be added to term hierarchy information.
}

Implements TermStorageInterface.

References Drupal\database(), and EntityInterface\id().

Here is the call graph for this function:


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