public function Vocabulary::setHierarchy in Drupal 8
Sets the vocabulary hierarchy.
Parameters
int $hierarchy: The hierarchy type of vocabulary. Possible values:
- VocabularyInterface::HIERARCHY_DISABLED: No parents.
- VocabularyInterface::HIERARCHY_SINGLE: Single parent.
- VocabularyInterface::HIERARCHY_MULTIPLE: Multiple parents.
Return value
$this
Overrides VocabularyInterface::setHierarchy
Deprecated
in drupal:8.7.0 and is removed from drupal:9.0.0. Reset the cache of the taxonomy_term storage handler instead.
File
- core/
modules/ taxonomy/ src/ Entity/ Vocabulary.php, line 101
Class
- Vocabulary
- Defines the taxonomy vocabulary entity.
Namespace
Drupal\taxonomy\EntityCode
public function setHierarchy($hierarchy) {
@trigger_error('\\Drupal\\taxonomy\\VocabularyInterface::setHierarchy() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.x. Reset the cache of the taxonomy_term storage controller instead.', E_USER_DEPRECATED);
$this
->entityTypeManager()
->getStorage('taxonomy_term')
->resetCache();
return $this;
}