protected $defaultConfiguration =
[ 'bundle' => NULL,
'include_translations' => TRUE,
'add_revision_id' => TRUE,
];
/**
* {@inheritdoc}
*/
public function __construct(array
$configuration,
$plugin_id,
$plugin_definition, MigrationInterface
$migration, EntityTypeManagerInterface
$entity_type_manager, EntityFieldManagerInterface
$entity_field_manager, EntityTypeBundleInfoInterface
$entity_type_bundle_info) { if (empty($plugin_definition['entity_type'
])) { throw new InvalidPluginDefinitionException($plugin_id, 'Missing required "entity_type" definition.'
);
} $this->entityTypeManager =
$entity_type_manager;
$this->entityFieldManager =
$entity_field_manager;
$this->entityTypeBundleInfo =
$entity_type_bundle_info;
$this->entityType =
$this->entityTypeManager->
getDefinition($plugin_definition['entity_type'
]);
if (!
$this->entityType instanceof ContentEntityTypeInterface
) { throw new InvalidPluginDefinitionException($plugin_id,
sprintf('The entity type (%s) is not supported. The "content_entity" source plugin only supports content entities.',
$plugin_definition['entity_type'
]));
} if (!
empty($configuration['bundle'
])) { if (!
$this->entityType->
hasKey('bundle'
)) { throw new \
InvalidArgumentException(sprintf('A bundle was provided but the entity type (%s) is not bundleable.',
$plugin_definition['entity_type'
]));
}