.../migrate/destination/EntityContentMaster.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentMaster.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentMaster.php index dd968c1bae..69d2e9eb6e 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentMaster.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentMaster.php @@ -4,6 +4,7 @@ use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityChangedInterface; +use Drupal\migrate\EntityFieldDefinitionTrait; use Drupal\migrate\Row; /** @@ -16,6 +17,8 @@ */ class EntityContentMaster extends EntityContentBase { + use EntityFieldDefinitionTrait; + /** * {@inheritdoc} */ @@ -37,17 +40,6 @@ public function getIds() { return $ids; } - /** - * {@inheritdoc} - * - * @todo: Use EntityFieldDefinitionTrait instead. - * See https://www.drupal.org/project/drupal/issues/2937782. - */ - protected static function getEntityTypeId($plugin_id) { - // Remove entity_revision: - return substr($plugin_id, 14); - } - /** * Gets the entity. * @@ -60,9 +52,9 @@ protected static function getEntityTypeId($plugin_id) { * The entity. */ protected function getEntity(Row $row, array $old_destination_id_values) { - $revision_id = $old_destination_id_values ? - $old_destination_id_values[1] : - $row->getDestinationProperty($this->getKey('revision')); + $revision_id = $old_destination_id_values + ? $old_destination_id_values[1] + : $row->getDestinationProperty($this->getKey('revision')); if (!empty($revision_id) && ($entity = $this->storage->loadRevision($revision_id))) { $entity->setNewRevision(FALSE); }