You are here

protected function BaseUpdateRunner::addActiveUpdateConditions in Scheduled Updates 8

Add conditions to a query to select updates to run.

Parameters

\Drupal\Core\Entity\Query\QueryInterface $query:

string $condition_prefix: String to attach to the beginning of all conditions if the base table is not updates.

2 calls to BaseUpdateRunner::addActiveUpdateConditions()
BaseUpdateRunner::getEntityIdsReferencingReadyUpdates in src/Plugin/BaseUpdateRunner.php
Get all entity ids for entities that reference updates that are ready to run.
BaseUpdateRunner::getReadyUpdateIds in src/Plugin/BaseUpdateRunner.php
Get updates that are ready to be run for this Runner.

File

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

Class

BaseUpdateRunner

Namespace

Drupal\scheduled_updates\Plugin

Code

protected function addActiveUpdateConditions(QueryInterface $query, $condition_prefix = '') {
  $query
    ->condition($condition_prefix . 'update_timestamp', \Drupal::time()
    ->getRequestTime(), '<=');
  $query
    ->condition($condition_prefix . 'type', $this->scheduled_update_type
    ->id());
  $query
    ->condition($condition_prefix . 'status', [
    ScheduledUpdateInterface::STATUS_UNRUN,
  ], 'IN');
}