Drupal 8  8.0.2
SqlBase Class Reference
Inheritance diagram for SqlBase:

Public Member Functions

 __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 ContainerFactoryPluginInterface
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Member Functions

 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

 $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

Sources whose data may be fetched via DBTNG.

By default, an existing database connection with key 'migrate' and target 'default' is used. These may be overridden with explicit 'key' and/or 'target' configuration keys. In addition, if the configuration key 'database' is present, it is used as a database connection information array to define the connection.

Constructor & Destructor Documentation

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

{}

References Drupal\state().

Here is the call graph for this function:

Member Function Documentation

__toString ( )

Prints the query string when the object is used as a string.

Returns
string The query string.

Implements MigrateSourceInterface.

count ( )

{}

References SqlBase\query().

Referenced by SqlBase\initializeIterator(), and Field\prepareRow().

Here is the call graph for this function:

Here is the caller graph for this function:

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

{}

getDatabase ( )

Gets the database connection object.

Returns
The database connection.

References Drupal\database(), SqlBase\setUpDatabase(), and Drupal\state().

Referenced by User\baseFields(), SqlBase\mapJoinable(), User\prepareRow(), File\query(), Variable\query(), and SqlBase\select().

Here is the call graph for this function:

Here is the caller graph for this function:

initializeIterator ( )
protected

Implementation of MigrateSource::performRewind().

We could simply execute the query and be functionally correct, but we will take advantage of the PDO-based API to optimize the query up-front.

References SqlBase\count(), MigrateSourceInterface\getIds(), SqlBase\mapJoinable(), SqlBase\prepareQuery(), and SqlBase\query().

Referenced by ViewModeBase\count().

Here is the call graph for this function:

Here is the caller graph for this function:

mapJoinable ( )
protected

Checks if we can join against the map table.

This function specifically catches issues when we're migrating with unique sets of credentials for the source and destination database.

Returns
bool TRUE if we can join against the map table otherwise FALSE.

References SqlBase\getDatabase(), and MigrateSourceInterface\getIds().

Referenced by SqlBase\initializeIterator().

Here is the call graph for this function:

Here is the caller graph for this function:

prepareQuery ( )
protected

Adds tags and metadata to the query.

Returns
The query with additional tags and metadata.

References SqlBase\query().

Referenced by ViewMode\initializeIterator(), FieldInstancePerFormDisplay\initializeIterator(), FieldInstancePerViewMode\initializeIterator(), SqlBase\initializeIterator(), and Variable\values().

Here is the call graph for this function:

Here is the caller graph for this function:

query ( )
abstract
Returns

Referenced by SqlBase\count(), SqlBase\initializeIterator(), and SqlBase\prepareQuery().

Here is the caller graph for this function:

select (   $table,
  $alias = NULL,
array  $options = array() 
)
protected

Wrapper for database select.

References SqlBase\getDatabase().

Referenced by User\fields(), ProfileFieldValues\fields(), CommentVariable\getCommentVariables(), Node\getFieldInfo(), FieldableEntity\getFields(), FieldableEntity\getFieldValues(), DrupalSqlBase\getSystemData(), ContactSettings\initializeIterator(), UploadInstance\initializeIterator(), CommentType\initializeIterator(), Role\initializeIterator(), ProfileFieldValues\prepareRow(), Upload\prepareRow(), FilterFormat\prepareRow(), ImageStyles\prepareRow(), User\prepareRow(), ImageCachePreset\prepareRow(), TermNode\prepareRow(), ProfileField\prepareRow(), Vocabulary\prepareRow(), Field\prepareRow(), Role\prepareRow(), NodeType\prepareRow(), Term\prepareRow(), Block\prepareRow(), UrlAliasBase\query(), Box\query(), BlockCustom\query(), Book\query(), Shortcut\query(), ShortcutSetUsers\query(), ShortcutSet\query(), TrackerNode\query(), TrackerUser\query(), BlockedIps\query(), Menu\query(), FilterFormat\query(), User\query(), AggregatorItem\query(), AggregatorFeed\query(), ContactCategory\query(), MenuLink\query(), ImageStyles\query(), Comment\query(), UserPicture\query(), Field\query(), FieldInstance\query(), Action\query(), Vocabulary\query(), ImageCachePreset\query(), ProfileFieldValues\query(), VariableMultiRow\query(), Upload\query(), TermNode\query(), Role\query(), CommentType\query(), UserPictureFile\query(), ProfileField\query(), Term\query(), Node\query(), File\query(), NodeType\query(), FieldInstancePerFormDisplay\query(), ViewMode\query(), Language\query(), Block\query(), FieldInstancePerViewMode\query(), and DrupalSqlBase\variableGet().

Here is the call graph for this function:

setUpDatabase ( array  $database_info)
protected

Gets a connection to the referenced database.

This method will add the database connection if necessary.

Parameters
array$database_infoConfiguration for the source database connection. The keys are: 'key' - The database connection key. 'target' - The database connection target. 'database' - Database configuration array as accepted by Database::addConnectionInfo.
Returns
The connection to use for this plugin's queries.

References Database\addConnectionInfo(), and Database\getConnection().

Referenced by SqlBase\getDatabase().

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: