diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php index 1697c16..7fb16ab 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php @@ -132,30 +132,6 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function __get($name) { - $name = ($name == 'value') ? 'target_id' : $name; - return parent::__get($name); - } - - /** - * {@inheritdoc} - */ - public function get($property_name) { - $property_name = ($property_name == 'value') ? 'target_id' : $property_name; - return parent::get($property_name); - } - - /** - * {@inheritdoc} - */ - public function __isset($property_name) { - $property_name = ($property_name == 'value') ? 'target_id' : $property_name; - return parent::__isset($property_name); - } - - /** - * {@inheritdoc} - */ public function setValue($values, $notify = TRUE) { if (isset($values) && !is_array($values)) { // Directly update the property instead of invoking the parent, so it can diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php index abbd3c4..37fd4b1 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php @@ -125,7 +125,7 @@ public function testAccess() { entity_view($referencing_entity, 'default'); // Verify the un-accessible item still exists. - $this->assertEqual($referencing_entity->{$field_name}->value, $this->referencedEntity->id(), format_string('The un-accessible item still exists after @name formatter was executed.', array('@name' => $name))); + $this->assertEqual($referencing_entity->{$field_name}->target_id, $this->referencedEntity->id(), format_string('The un-accessible item still exists after @name formatter was executed.', array('@name' => $name))); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php index 409f6d2..9b1b78c 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php @@ -73,17 +73,17 @@ public function testComments() { $this->assertEqual('The first comment.', $comment->subject->value); $this->assertEqual('The first comment body.', $comment->comment_body->value); $this->assertEqual('filtered_html', $comment->comment_body->format); - $this->assertEqual(0, $comment->pid->value); - $this->assertEqual(1, $comment->entity_id->value); + $this->assertEqual(0, $comment->pid->target_id); + $this->assertEqual(1, $comment->entity_id->target_id); $this->assertEqual('node', $comment->entity_type->value); $this->assertEqual(Language::LANGCODE_NOT_SPECIFIED, $comment->language()->id); $comment = entity_load('comment', 2); $this->assertEqual('The response to the second comment.', $comment->subject->value); - $this->assertEqual(3, $comment->pid->value); + $this->assertEqual(3, $comment->pid->target_id); $comment = entity_load('comment', 3); $this->assertEqual('The second comment.', $comment->subject->value); - $this->assertEqual(0, $comment->pid->value); + $this->assertEqual(0, $comment->pid->target_id); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyTermTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyTermTest.php index a4f5b13..684b626 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyTermTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyTermTest.php @@ -96,7 +96,7 @@ public function testTaxonomyTerms() { $term = $terms[$tid]; $this->assertIdentical($term->name->value, "term {$tid} of vocabulary {$values['source_vid']}"); $this->assertIdentical($term->description->value, "description of term {$tid} of vocabulary {$values['source_vid']}"); - $this->assertEqual($term->vid->value, $values['vid']); + $this->assertEqual($term->vid->target_id, $values['vid']); $this->assertEqual($term->weight->value, $values['weight']); if (empty($values['parent'])) { $this->assertNull($term->parent->value); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeRevisionTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeRevisionTest.php index 325bb73..20c4a0f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeRevisionTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeRevisionTest.php @@ -53,8 +53,8 @@ protected function setUp() { public function testTermRevisionNode() { $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2); $this->assertEqual(count($node->vocabulary_3_i_2_), 2); - $this->assertEqual($node->vocabulary_3_i_2_[0]->value, 4); - $this->assertEqual($node->vocabulary_3_i_2_[1]->value, 5); + $this->assertEqual($node->vocabulary_3_i_2_[0]->target_id, 4); + $this->assertEqual($node->vocabulary_3_i_2_[1]->target_id, 5); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeTest.php index 8d24dfc..2b3ab48 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeTest.php @@ -45,11 +45,11 @@ public function testTermNode() { $nodes = node_load_multiple(array(1, 2), TRUE); $node = $nodes[1]; $this->assertEqual(count($node->vocabulary_1_i_0_), 1); - $this->assertEqual($node->vocabulary_1_i_0_[0]->value, 1); + $this->assertEqual($node->vocabulary_1_i_0_[0]->target_id, 1); $node = $nodes[2]; $this->assertEqual(count($node->vocabulary_2_i_1_), 2); - $this->assertEqual($node->vocabulary_2_i_1_[0]->value, 2); - $this->assertEqual($node->vocabulary_2_i_1_[1]->value, 3); + $this->assertEqual($node->vocabulary_2_i_1_[0]->target_id, 2); + $this->assertEqual($node->vocabulary_2_i_1_[1]->target_id, 3); } }