You are here

protected function BaseUpdateRunner::getEntityIdsReferencingReadyUpdates in Scheduled Updates 8

Get all entity ids for entities that reference updates that are ready to run.

This default function will only get default entity revisions.

Return value

array

1 call to BaseUpdateRunner::getEntityIdsReferencingReadyUpdates()
EmbeddedUpdateRunner::getEmbeddedUpdates in src/Plugin/UpdateRunner/EmbeddedUpdateRunner.php
Return all schedule updates that are referenced via Entity Reference fields.
1 method overrides BaseUpdateRunner::getEntityIdsReferencingReadyUpdates()
LatestRevisionUpdateRunner::getEntityIdsReferencingReadyUpdates in src/Plugin/UpdateRunner/LatestRevisionUpdateRunner.php
This method is overridden because the version in BaseUpdateRunner only needs to get default revisions so does not call $query->allRevisions().

File

src/Plugin/BaseUpdateRunner.php, line 157
Contains \Drupal\scheduled_updates\Plugin\BaseUpdateRunner.

Class

BaseUpdateRunner

Namespace

Drupal\scheduled_updates\Plugin

Code

protected function getEntityIdsReferencingReadyUpdates() {
  $entity_ids = [];
  if ($field_ids = $this
    ->getReferencingFieldIds()) {
    $entity_storage = $this->entityTypeManager
      ->getStorage($this
      ->updateEntityType());
    foreach ($field_ids as $field_id) {
      $query = $entity_storage
        ->getQuery('AND');
      $this
        ->addActiveUpdateConditions($query, "{$field_id}.entity.");
      $entity_ids += $query
        ->execute();
    }
  }
  return $entity_ids;
}