You are here

public function EmbeddedUpdateRunner::onEntityUpdate in Scheduled Updates 8

Fires when entity of type to be updated is changed.

This function is fired every time and entity of the type that the Scheduled Update Type is up

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity:

Return value

mixed

Overrides EntityMonitorUpdateRunnerInterface::onEntityUpdate

File

src/Plugin/UpdateRunner/EmbeddedUpdateRunner.php, line 85
Contains \Drupal\scheduled_updates\Plugin\UpdateRunner\EmbeddedUpdateRunner.

Class

EmbeddedUpdateRunner
The default Embedded Update Runner.

Namespace

Drupal\scheduled_updates\Plugin\UpdateRunner

Code

public function onEntityUpdate(ContentEntityInterface $entity) {
  if ($this->updateUtils
    ->supportsRevisionUpdates($this->scheduled_update_type)) {
    $this
      ->deactivateUpdates($entity);
    $this
      ->reactivateUpdates($entity);
  }
}