diff core/modules/taxonomy/src/Entity/Vocabulary.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/core/modules/taxonomy/src/Entity/Vocabulary.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/taxonomy/src/Entity/Vocabulary.php	Thu May 09 15:34:47 2019 +0100
@@ -53,7 +53,6 @@
  *     "name",
  *     "vid",
  *     "description",
- *     "hierarchy",
  *     "weight",
  *   }
  * )
@@ -82,18 +81,6 @@
   protected $description;
 
   /**
-   * The type of hierarchy allowed within the vocabulary.
-   *
-   * Possible values:
-   * - VocabularyInterface::HIERARCHY_DISABLED: No parents.
-   * - VocabularyInterface::HIERARCHY_SINGLE: Single parent.
-   * - VocabularyInterface::HIERARCHY_MULTIPLE: Multiple parents.
-   *
-   * @var int
-   */
-  protected $hierarchy = VocabularyInterface::HIERARCHY_DISABLED;
-
-  /**
    * The weight of this vocabulary in relation to other vocabularies.
    *
    * @var int
@@ -104,14 +91,16 @@
    * {@inheritdoc}
    */
   public function getHierarchy() {
-    return $this->hierarchy;
+    @trigger_error('\Drupal\taxonomy\VocabularyInterface::getHierarchy() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.x. Use \Drupal\taxonomy\TermStorage::getVocabularyHierarchyType() instead.', E_USER_DEPRECATED);
+    return $this->entityTypeManager()->getStorage('taxonomy_term')->getVocabularyHierarchyType($this->id());
   }
 
   /**
    * {@inheritdoc}
    */
   public function setHierarchy($hierarchy) {
-    $this->hierarchy = $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;
   }