class IdMapFilter in Migrate Tools 8.5
Same name and namespace in other branches
- 8.4 src/IdMapFilter.php \Drupal\migrate_tools\IdMapFilter
Class to filter ID map by an ID list.
Hierarchy
- class \Drupal\migrate_tools\IdMapFilter extends \Drupal\migrate_tools\FilterIterator
Expanded class hierarchy of IdMapFilter
1 file declares its use of IdMapFilter
- MigrateToolsCommands.php in src/
Commands/ MigrateToolsCommands.php
File
- src/
IdMapFilter.php, line 10
Namespace
Drupal\migrate_toolsView source
class IdMapFilter extends \FilterIterator {
/**
* List of specific source IDs to import.
*
* @var array
*/
protected $idList;
/**
* IdMapFilter constructor.
*
* @param \Drupal\migrate\Plugin\MigrateIdMapInterface $id_map
* The ID map.
* @param array $id_list
* The id list to use in the filter.
*/
public function __construct(MigrateIdMapInterface $id_map, array $id_list) {
parent::__construct($id_map);
$this->idList = $id_list;
}
/**
* {@inheritdoc}
*/
public function accept() {
// Row is included.
if (empty($this->idList) || in_array(array_values($this
->getInnerIterator()
->currentSource()), $this->idList)) {
return TRUE;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IdMapFilter:: |
protected | property | List of specific source IDs to import. | |
IdMapFilter:: |
public | function | ||
IdMapFilter:: |
public | function | IdMapFilter constructor. |