Drupal 8  8.0.2
DrupalSqlBase Class Reference

Inherits SqlBase, ContainerFactoryPluginInterface, RequirementsInterface, and DependentPluginInterface.

Inherited by Action, AggregatorFeed, AggregatorItem, BlockedIps, Block, Box, BlockCustom, Book, Comment, CommentVariable, CommentType, ContactCategory, Field, FieldInstance, FieldInstancePerFormDisplay, Field, FieldInstance, FieldInstancePerFormDisplay, FieldInstancePerViewMode, ViewMode, File, Upload, UploadInstance, File, FilterFormat, FilterFormat, ImageCachePreset, ImageStyles, Language, MenuLink, FieldableEntity, Variable, VariableMultiRow, Node, NodeType, ViewModeBase, NodeType, UrlAliasBase, Shortcut, ShortcutSet, ShortcutSetUsers, Menu, TermNode, Vocabulary, Vocabulary, Term, TestDrupal6SqlBase, TrackerNode, TrackerUser, ProfileFieldValues, Role, User, UserPicture, UserPictureFile, Role, ProfileField, and UserPictureInstance.

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state, EntityManagerInterface $entity_manager)
 
 getSystemData ()
 
 checkRequirements ()
 
 calculateDependencies ()
 
- Public Member Functions inherited from SqlBase
 __construct (array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state)
 
 __toString ()
 
 getDatabase ()
 
 query ()
 
 count ()
 
- Public Member Functions inherited from SourcePluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration)
 
 prepareRow (Row $row)
 
 current ()
 
 key ()
 
 valid ()
 
 rewind ()
 
 next ()
 
 getCurrentIds ()
 
 count ($refresh=FALSE)
 
- Public Member Functions inherited from MigrateSourceInterface
 fields ()
 
 getIds ()
 
- 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 SqlBase
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

 getModuleSchemaVersion ($module)
 
 moduleExists ($module)
 
 variableGet ($name, $default)
 
- Protected Member Functions inherited from SqlBase
 setUpDatabase (array $database_info)
 
 select ($table, $alias=NULL, array $options=array())
 
 prepareQuery ()
 
 initializeIterator ()
 
 mapJoinable ()
 
- Protected Member Functions inherited from SourcePluginBase
 initializeIterator ()
 
 getModuleHandler ()
 
 getIterator ()
 
 aboveHighwater (Row $row)
 
 rowChanged (Row $row)
 
 getCache ()
 

Protected Attributes

 $systemData
 
 $requirements = TRUE
 
 $entityManager
 
- Protected Attributes inherited from SqlBase
 $query
 
 $database
 
 $state
 
- Protected Attributes inherited from SourcePluginBase
 $moduleHandler
 
 $migration
 
 $highWaterProperty
 
 $currentRow
 
 $currentSourceIds
 
 $originalHighWater
 
 $cacheCounts = FALSE
 
 $cacheKey
 
 $skipCount = FALSE
 
 $trackChanges = FALSE
 
 $mapRowAdded = FALSE
 
 $cache
 
 $idMap
 
 $iterator
 

Detailed Description

A base source class for Drupal migrate sources.

Mainly to let children retrieve information from the origin system in an easier way.

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
MigrationInterface  $migration,
StateInterface  $state,
EntityManagerInterface  $entity_manager 
)

{}

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

calculateDependencies ( )

{Calculates dependencies for the configured plugin.Dependencies are saved in the plugin's configuration entity and are used to determine configuration synchronization order. For example, if the plugin integrates with specific user roles, this method should return an array of dependencies listing the specified roles.

Returns
array An array of dependencies grouped by type (config, content, module, theme). For example:
array(
'config' => array('user.role.anonymous', 'user.role.authenticated'),
'content' => array('node:article:f0a189e6-55fb-47fb-8005-5bef81c44d6d'),
'module' => array('node', 'user'),
'theme' => array('seven'),
);
See Also
::getConfigDependencyName()
}

Implements DependentPluginInterface.

References Drupal\entityManager().

Here is the call graph for this function:

checkRequirements ( )

{Checks if requirements for this plugin are OK.

Exceptions
\Drupal\migrate\Exception\RequirementsExceptionThrown when requirements are not met.
}

Implements RequirementsInterface.

References DrupalSqlBase\getModuleSchemaVersion(), and DrupalSqlBase\moduleExists().

Here is the call graph for this function:

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

{}

getModuleSchemaVersion (   $module)
protected

Get a module schema_version value in the source installation.

Parameters
string$moduleName of module.
Returns
mixed The current module schema version on the origin system table or FALSE if not found.

References DrupalSqlBase\getSystemData().

Referenced by DrupalSqlBase\checkRequirements(), AggregatorFeed\fields(), Action\fields(), Term\fields(), Action\prepareRow(), Node\prepareRow(), ProfileField\query(), Term\query(), and Block\query().

Here is the call graph for this function:

Here is the caller graph for this function:

getSystemData ( )

Retrieves all system data information from origin system.

Returns
array List of system table information keyed by type and name.

References SqlBase\select().

Referenced by DrupalSqlBase\getModuleSchemaVersion(), and DrupalSqlBase\moduleExists().

Here is the call graph for this function:

Here is the caller graph for this function:

moduleExists (   $module)
protected

Check to see if a given module is enabled in the source installation.

Parameters
string$moduleName of module to check.
Returns
bool TRUE if module is enabled on the origin system, FALSE if not.

References DrupalSqlBase\getSystemData().

Referenced by DrupalSqlBase\checkRequirements(), User\fields(), NodeType\prepareRow(), and Node\prepareRow().

Here is the call graph for this function:

Here is the caller graph for this function:

variableGet (   $name,
  $default 
)
protected

Read a variable from a Drupal database.

Parameters
$nameName of the variable.
$defaultThe default value.
Returns
mixed

References SqlBase\select().

Referenced by UploadInstance\initializeIterator(), UserPictureInstance\initializeIterator(), UserPictureFile\initializeIterator(), File\initializeIterator(), Block\initializeIterator(), Node\initializeIterator(), NodeType\initializeIterator(), Comment\prepareRow(), FilterFormat\prepareRow(), CommentType\prepareRow(), NodeType\prepareRow(), and Block\prepareRow().

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: