Migrate in core #2125717 by mikeryan, chx, marvil07, bdone, jessehs, mpgeek, BTMash, fastangel, mongolito404, Moshe Weitzman, eliza411, YesCT, dawehner, cosmicdreams
2013-11-20 22:08:56 +00:00
< ? php
use Drupal\migrate\Entity\MigrationInterface ;
use Drupal\migrate\Plugin\MigrateSourceInterface ;
use Drupal\migrate\Row ;
/**
* @ file
* Hooks provided by the Migrate module .
*/
/**
* @ addtogroup hooks
* @ {
*/
/**
* Allows adding data to a row before processing it .
*
* For example , filter module used to store filter format settings in the
* variables table which now needs to be inside the filter format config
* file . So , it needs to be added here .
*
* hook_migrate_MIGRATION_ID_prepare_row is also available .
*/
function hook_migrate_prepare_row ( Row $row , MigrateSourceInterface $source , MigrationInterface $migration ) {
Issue #2213451 by andypost, bdone, benjy, penyaskito, chx, claudiu.cristea, damiankloip, gregboggs, InternetDevels, jessehs, jhedstrom, marvil07, mikeryan, pcambra, Xano, YesCT: Update Migrate API in core
2014-03-19 18:56:48 +00:00
if ( $migration -> id () == 'd6_filter_formats' ) {
Migrate in core #2125717 by mikeryan, chx, marvil07, bdone, jessehs, mpgeek, BTMash, fastangel, mongolito404, Moshe Weitzman, eliza411, YesCT, dawehner, cosmicdreams
2013-11-20 22:08:56 +00:00
$value = $source -> getDatabase () -> query ( 'SELECT value FROM {variable} WHERE name = :name' , array ( ':name' => 'mymodule_filter_foo_' . $row -> getSourceProperty ( 'format' ))) -> fetchField ();
if ( $value ) {
$row -> setSourceProperty ( 'settings:mymodule:foo' , unserialize ( $value ));
}
}
}
/**
* @ } End of " addtogroup hooks " .
*/