Drupal 8  8.0.2
EntityContentBase Class Reference
Inheritance diagram for EntityContentBase:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager)
 
 import (Row $row, array $old_destination_id_values=array())
 
 getIds ()
 
- Public Member Functions inherited from Entity
 __construct (array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles)
 
 fields (MigrationInterface $migration=NULL)
 
 rollback (array $destination_identifier)
 
 calculateDependencies ()
 
- Public Member Functions inherited from DestinationBase
 __construct (array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration)
 
 rollbackAction ()
 
 checkRequirements ()
 
 rollback (array $destination_identifier)
 
 supportsRollback ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration=NULL)
 
- Static Public Member Functions inherited from Entity
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration=NULL)
 
- Static Public Member Functions inherited from ContainerFactoryPluginInterface
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Member Functions

 save (ContentEntityInterface $entity, array $old_destination_id_values=array())
 
 updateEntity (EntityInterface $entity, Row $row)
 
- Protected Member Functions inherited from Entity
 getEntity (Row $row, array $old_destination_id_values)
 
 getEntityId (Row $row)
 
 getKey ($key)
 
- Protected Member Functions inherited from DestinationBase
 setRollbackAction (array $id_map)
 

Protected Attributes

 $entityManager
 
 $fieldTypeManager
 
- Protected Attributes inherited from Entity
 $storage
 
 $bundles
 
- Protected Attributes inherited from DestinationBase
 $supportsRollback = FALSE
 
 $rollbackAction = MigrateIdMapInterface::ROLLBACK_DELETE
 
 $migration
 

Additional Inherited Members

- Static Protected Member Functions inherited from Entity
static getEntityTypeId ($plugin_id)
 

Detailed Description

The destination class for all content entities lacking a specific class.

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
MigrationInterface  $migration,
EntityStorageInterface  $storage,
array  $bundles,
EntityManagerInterface  $entity_manager,
FieldTypePluginManagerInterface  $field_type_manager 
)

Constructs a content entity.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
\Drupal\migrate\Entity\MigrationInterface$migrationThe migration entity.
\Drupal\Core\Entity\EntityStorageInterface$storageThe storage for this entity type.
array$bundlesThe list of bundles this entity type has.
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager service.
\Drupal\Core\Field\FieldTypePluginManagerInterface$field_type_managerThe field type plugin manager service.

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition,
MigrationInterface  $migration = NULL 
)
static

{}

getIds ( )

{Get the destination IDs.To support MigrateIdMap maps, derived destination classes should return schema field definition(s) corresponding to the primary key of the destination being implemented. These are used to construct the destination key fields of the map table for a migration using this destination.

Returns
array An array of IDs.
}

Implements MigrateDestinationInterface.

References Entity\getKey().

Here is the call graph for this function:

import ( Row  $row,
array  $old_destination_id_values = array() 
)

{Import the row.Derived classes must implement import(), to construct one new object (pre-populated) using ID mappings in the Migration.

Parameters
\Drupal\migrate\Row$rowThe row object.
array$old_destination_id_values(optional) The old destination IDs. Defaults to an empty array.
Returns
mixed The entity ID or an indication of success.
}

Implements MigrateDestinationInterface.

References Entity\getEntity(), MigrateIdMapInterface\ROLLBACK_DELETE, DestinationBase\rollbackAction(), and EntityContentBase\save().

Here is the call graph for this function:

save ( ContentEntityInterface  $entity,
array  $old_destination_id_values = array() 
)
protected

Saves the entity.

Parameters
\Drupal\Core\Entity\ContentEntityInterface$entityThe content entity.
array$old_destination_id_values(optional) An array of destination ID values. Defaults to an empty array.
Returns
array An array containing the entity ID.

References EntityInterface\id(), and EntityInterface\save().

Referenced by EntityContentBase\import(), and EntityContentBaseTest\testImport().

Here is the call graph for this function:

Here is the caller graph for this function:

updateEntity ( EntityInterface  $entity,
Row  $row 
)
protected

Updates an entity with the new values from row.

Parameters
\Drupal\Core\Entity\EntityInterface$entityThe entity to update.
\Drupal\migrate\Row$rowThe row object to update from.

References Row\cloneWithoutDestination(), Row\getDestination(), Row\getDestinationProperty(), Row\getIdMap(), and DestinationBase\setRollbackAction().

Referenced by EntityRevision\getEntity().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: