public function SourceFilter::accept in Migrate Tools 8.5
Same name and namespace in other branches
- 8.4 src/SourceFilter.php \Drupal\migrate_tools\SourceFilter::accept()
File
- src/
SourceFilter.php, line 36
Class
- SourceFilter
- Class to filter source by an ID list.
Namespace
Drupal\migrate_toolsCode
public function accept() {
// No idlist filtering, don't filter.
if (empty($this->idList)) {
return TRUE;
}
// Some source plugins do not extend SourcePluginBase. These cannot be
// filtered so warn and return all values.
if (!$this
->getInnerIterator() instanceof SourcePluginBase) {
trigger_error(sprintf('The source plugin %s is not an instance of %s. Extend from %s to support idlist filtering.', $this
->getInnerIterator()
->getPluginId(), SourcePluginBase::class, SourcePluginBase::class));
return TRUE;
}
// Row is included.
if (in_array(array_values($this
->getInnerIterator()
->getCurrentIds()), $this->idList)) {
return TRUE;
}
}