protected function DrupalSqlBase::variableGet in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase::variableGet()
Read a variable from a Drupal database.
Parameters
$name: Name of the variable.
$default: The default value.
Return value
mixed
16 calls to DrupalSqlBase::variableGet()
- Block::initializeIterator in core/
modules/ block/ src/ Plugin/ migrate/ source/ Block.php - Implementation of MigrateSource::performRewind().
- Block::prepareRow in core/
modules/ block/ src/ Plugin/ migrate/ source/ Block.php - Add additional data to the row.
- Comment::prepareRow in core/
modules/ comment/ src/ Plugin/ migrate/ source/ d6/ Comment.php - Add additional data to the row.
- CommentType::prepareRow in core/
modules/ comment/ src/ Plugin/ migrate/ source/ d7/ CommentType.php - Add additional data to the row.
- File::initializeIterator in core/
modules/ file/ src/ Plugin/ migrate/ source/ d6/ File.php - Implementation of MigrateSource::performRewind().
File
- core/
modules/ migrate_drupal/ src/ Plugin/ migrate/ source/ DrupalSqlBase.php, line 154 - Contains \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase.
Class
- DrupalSqlBase
- A base source class for Drupal migrate sources.
Namespace
Drupal\migrate_drupal\Plugin\migrate\sourceCode
protected function variableGet($name, $default) {
try {
$result = $this
->select('variable', 'v')
->fields('v', array(
'value',
))
->condition('name', $name)
->execute()
->fetchField();
} catch (\Exception $e) {
$result = FALSE;
}
return $result !== FALSE ? unserialize($result) : $default;
}