本文整理汇总了PHP中Drupal\migrate\MigrateExecutable::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP MigrateExecutable::__construct方法的具体用法?PHP MigrateExecutable::__construct怎么用?PHP MigrateExecutable::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\migrate\MigrateExecutable
的用法示例。
在下文中一共展示了MigrateExecutable::__construct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* {@inheritdoc}
*/
public function __construct(MigrationInterface $migration, MigrateMessageInterface $message, array $options = [])
{
parent::__construct($migration, $message);
if (isset($options['limit'])) {
$this->itemLimit = $options['limit'];
}
if (isset($options['feedback'])) {
$this->feedback = $options['feedback'];
}
if (isset($options['idlist'])) {
$this->idlist = explode(',', $options['idlist']);
}
$this->listeners[MigrateEvents::MAP_SAVE] = array($this, 'onMapSave');
$this->listeners[MigrateEvents::MAP_DELETE] = array($this, 'onMapDelete');
$this->listeners[MigrateEvents::POST_IMPORT] = array($this, 'onPostImport');
$this->listeners[MigrateEvents::PRE_ROW_SAVE] = array($this, 'onPreRowSave');
$this->listeners[MigrateEvents::POST_ROW_SAVE] = array($this, 'onPostRowSave');
$this->listeners[MigratePlusEvents::PREPARE_ROW] = array($this, 'onPrepareRow');
foreach ($this->listeners as $event => $listener) {
\Drupal::service('event_dispatcher')->addListener($event, $listener);
}
}