5 * Contains \Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer\NodeCollectorTrait.
8 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer;
11 * Trait used by fixers which loop through existing indexer objects and do
14 trait NodeCollectorTrait {
16 protected function getObjects() {
17 /** @var \Pharborist\NodeCollection $objects */
18 $objects = $this->target->getIndexer($this->configuration['type'])->get($this->configuration['id']);
20 if (isset($this->configuration['where'])) {
21 $where = $this->configuration['where'];
22 // If the first character of the filter is an exclamation point, negate it.
23 return ($where{0} == '!' ? $objects->not(subStr($where, 1)) : $objects->filter($where));