diff -u b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php --- b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php @@ -49,13 +49,13 @@ $this->assertEqual($vocabulary->getName(), "vocabulary $j (i=$i)"); $this->assertEqual($vocabulary->getDescription(), "description of vocabulary $j (i=$i)"); $this->assertEqual($vocabulary->getHierarchy(), $i); - $this->assertEqual($vocabulary->getWeight(), 4 + $i); + $this->assertEqual($vocabulary->get('weight'), 4 + $i); } $vocabulary = entity_load('taxonomy_vocabulary', 'vocabulary_name_much_longer_than'); $this->assertEqual($vocabulary->getName(), 'vocabulary name much longer than thirty two characters'); $this->assertEqual($vocabulary->getDescription(), 'description of vocabulary name much longer than thirty two characters'); $this->assertEqual($vocabulary->getHierarchy(), 3); - $this->assertEqual($vocabulary->getWeight(), 7); + $this->assertEqual($vocabulary->get('weight'), 7); } } diff -u b/core/modules/taxonomy/src/Entity/Vocabulary.php b/core/modules/taxonomy/src/Entity/Vocabulary.php --- b/core/modules/taxonomy/src/Entity/Vocabulary.php +++ b/core/modules/taxonomy/src/Entity/Vocabulary.php @@ -142,21 +142,6 @@ /** * {@inheritdoc} */ - public function getWeight() { - return $this->get('weight'); - } - - /** - * {@inheritdoc} - */ - public function setWeight($weight) { - $this->set('weight', $weight); - return $this; - } - - /** - * {@inheritdoc} - */ public function getDescription() { return $this->get('description'); } @@ -164,14 +149,6 @@ /** * {@inheritdoc} */ - public function setDescription($description) { - $this->set('description', $description); - return $this; - } - - /** - * {@inheritdoc} - */ public function getHierarchy() { return $this->get('hierarchy'); } @@ -187,21 +164,6 @@ /** * {@inheritdoc} */ - public function getVid() { - return $this->get('vid'); - } - - /** - * {@inheritdoc} - */ - public function setVid($machineName) { - $this->set('vid', $machineName); - return $this; - } - - /** - * {@inheritdoc} - */ public function getName() { return $this->get('name'); } @@ -253,9 +215,2 @@ - /** - * {@inheritdoc} - */ - public function id() { - return $this->vid; - } - } diff -u b/core/modules/taxonomy/src/Tests/TermFieldTest.php b/core/modules/taxonomy/src/Tests/TermFieldTest.php --- b/core/modules/taxonomy/src/Tests/TermFieldTest.php +++ b/core/modules/taxonomy/src/Tests/TermFieldTest.php @@ -166,7 +166,7 @@ $this->field_storage->save(); // Change the machine name. $new_name = Unicode::strtolower($this->randomMachineName()); - $this->vocabulary->setVid($new_name); + $this->vocabulary->set('vid', $new_name); $this->vocabulary->save(); // Check that the field is still attached to the vocabulary. diff -u b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php --- b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php +++ b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php @@ -75,7 +75,7 @@ // Change the name and description. $vocabulary = $original_vocabulary; $vocabulary->setName($this->randomMachineName()); - $vocabulary->setDescription($this->randomMachineName()); + $vocabulary->set('description', $this->randomMachineName()); $vocabulary->save(); // Load the vocabulary. @@ -100,13 +100,13 @@ // Create some vocabularies and assign weights. $vocabulary1 = $this->createVocabulary(); - $vocabulary1->setWeight(0); + $vocabulary1->set('weight', 0); $vocabulary1->save(); $vocabulary2 = $this->createVocabulary(); - $vocabulary2->setWeight(1); + $vocabulary2->set('weight', 1); $vocabulary2->save(); $vocabulary3 = $this->createVocabulary(); - $vocabulary3->setWeight(2); + $vocabulary3->set('weight', 2); $vocabulary3->save(); // Check if third party settings exist. @@ -159,7 +159,7 @@ // Change the machine name. $old_name = $this->vocabulary->id(); $new_name = Unicode::strtolower($this->randomMachineName()); - $this->vocabulary->setVid($new_name); + $this->vocabulary->set('vid', $new_name); $this->vocabulary->save(); // Check that entity bundles are properly updated. diff -u b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php --- b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php +++ b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php @@ -83,8 +83,8 @@ $vocabularies = entity_load_multiple('taxonomy_vocabulary'); $edit = array(); foreach ($vocabularies as $key => $vocabulary) { - $weight = -$vocabulary->getWeight(); - $vocabularies[$key]->setWeight($weight); + $weight = -$vocabulary->get('weight'); + $vocabularies[$key]->set('weight', $weight); $edit['vocabularies[' . $key . '][weight]'] = $weight; } // Saving the new weights via the interface. @@ -96,7 +96,7 @@ // Check that the weights are saved in the database correctly. foreach ($vocabularies as $key => $vocabulary) { - $this->assertEqual($new_vocabularies[$key]->getWeight(), $vocabularies[$key]->getWeight(), 'The vocabulary weight was changed.'); + $this->assertEqual($new_vocabularies[$key]->get('weight'), $vocabularies[$key]->get('weight'), 'The vocabulary weight was changed.'); } } diff -u b/core/modules/taxonomy/src/VocabularyInterface.php b/core/modules/taxonomy/src/VocabularyInterface.php --- b/core/modules/taxonomy/src/VocabularyInterface.php +++ b/core/modules/taxonomy/src/VocabularyInterface.php @@ -34,25 +34,6 @@ public function getName(); /** - * Sets the vocabulary weight. - * - * @param integer $weight - * The weight of vocabulary. - * - * @return \Drupal\taxonomy\VocabularyInterface - * The called Vocabulary entity. - */ - public function setWeight($weight); - - /** - * Returns the vocabulary weight. - * - * @return integer - * The vocabulary weight. - */ - public function getWeight(); - - /** * Sets the vocabulary hierarchy. * * @param integer $hierarchy @@ -76,17 +57,6 @@ public function getHierarchy(); /** - * Sets the vocabulary description. - * - * @param string description - * The vocabulary description. - * - * @return \Drupal\taxonomy\VocabularyInterface - * The called Vocabulary entity. - */ - public function setDescription($description); - - /** * Returns the vocabulary description. * * @return string @@ -96,20 +66,2 @@ - /** - * Sets the vocabulary vid. - * - * @param string $machineName - * The vocabulary machine name. - * - * @return \Drupal\taxonomy\VocabularyInterface - * The called Vocabulary entity. - */ - public function setVid($machineName); - - /** - * Returns the vocabulary vid. - * - * @return string - * The vocabulary machine name. - */ - public function getVid(); } diff -u b/core/modules/views/src/Tests/ViewsTaxonomyAutocompleteTest.php b/core/modules/views/src/Tests/ViewsTaxonomyAutocompleteTest.php --- b/core/modules/views/src/Tests/ViewsTaxonomyAutocompleteTest.php +++ b/core/modules/views/src/Tests/ViewsTaxonomyAutocompleteTest.php @@ -67,7 +67,7 @@ public function testTaxonomyAutocomplete() { $this->user = $this->drupalCreateUser(array('access content')); $this->drupalLogin($this->user); - $base_autocomplete_path = 'taxonomy/autocomplete_vid/' . $this->vocabulary->getVid(); + $base_autocomplete_path = 'taxonomy/autocomplete_vid/' . $this->vocabulary->id(); // Test that no terms returns an empty array. $this->assertIdentical(array(), $this->drupalGetJSON($base_autocomplete_path));