You are here

interface UpdateRunnerInterface in Scheduled Updates 8

Interface for Update Runner Plugins.

Update Runners control on updates are run and how they are connected to entities.

Hierarchy

Expanded class hierarchy of UpdateRunnerInterface

All classes that implement UpdateRunnerInterface

6 files declare their use of UpdateRunnerInterface
AddFieldScheduledUpdateTypeTest.php in tests/src/FunctionalJavascript/AddFieldScheduledUpdateTypeTest.php
Contains \Drupal\Tests\scheduled_updates\AddFieldScheduledUpdateTypeTest.
EmbeddedScheduledUpdateTypeTest.php in tests/src/FunctionalJavascript/EmbeddedScheduledUpdateTypeTest.php
Contains \Drupal\Tests\scheduled_updates\EmbeddedScheduledUpdateTypeTest.
IndependentUpdateRunner.php in src/Plugin/UpdateRunner/IndependentUpdateRunner.php
Contains \Drupal\scheduled_updates\Plugin\UpdateRunner\IndependentUpdateRunner.
ScheduledUpdatesTestBase.php in tests/src/FunctionalJavascript/ScheduledUpdatesTestBase.php
Contains \Drupal\Tests\scheduled_updates\ScheduledUpdatesTestBase.
ScheduledUpdateTypeBaseForm.php in src/Form/ScheduledUpdateTypeBaseForm.php
Contains \Drupal\scheduled_updates\Form\ScheduledUpdateTypeBaseForm.

... See full list

File

src/Plugin/UpdateRunnerInterface.php, line 18
Contains Drupal\scheduled_updates\Plugin\UpdateRunnerInterface.

Namespace

Drupal\scheduled_updates\Plugin
View source
interface UpdateRunnerInterface extends PluginInspectionInterface, ContainerFactoryPluginInterface, PluginFormInterface {

  // Constants for Invalid Updates
  const INVALID_DELETE = 'DELETE';
  const INVALID_REQUEUE = 'REQUEUE';
  const INVALID_ARCHIVE = 'ARCHIVE';

  // Constants for behavior after updates are run.
  const AFTER_DELETE = 'DELETE';
  const AFTER_ARCHIVE = 'ARCHIVE';

  // Constants for revisions.
  const REVISIONS_BUNDLE_DEFAULT = 'BUNDLE_DEFAULT';
  const REVISIONS_YES = 'YES';
  const REVISIONS_NO = 'NO';

  // Constants for update user
  const USER_UPDATE_RUNNER = 'USER_UPDATE_RUNNER';
  const USER_OWNER = 'USER_OWNER';
  const USER_REVISION_OWNER = 'USER_REVISION_OWNER';
  const USER_UPDATE_OWNER = 'USER_UPDATE_OWNER';

  /**
   * Add all updates to queue.
   */
  public function addUpdatesToQueue();

  /**
   * Get the Queue for this Update Runner.
   *
   * @return \Drupal\Core\Queue\QueueInterface
   *   The queue object.
   */
  public function getQueue();

  /**
   * Run all updates that are in the queue.
   *
   * @param $time_end
   *  The time in seconds when no more updates should be run.
   *
   * @return
   */
  public function runUpdatesInQueue($time_end);

  /**
   * Get how this runner should handle invalid entity updates.
   *
   * @return string
   */
  public function getInvalidUpdateBehavior();

  /**
   * Get all field ids that are attached to the entity type to be updated and
   * target this update type.
   *
   * @return array
   */
  public function getReferencingFieldIds();

  /**
   * Return the entity id of the entity type being updated.
   *
   * @return string
   */
  public function updateEntityType();

  /**
   * Get target entity ids for an entity reference field on a entity.
   *
   * @todo Is there a way to do this with core Field API?
   *
   * @todo move this to a Utils trait or class.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   * @param $field_name
   *
   * @param bool $sort
   *
   * @return array Entity Ids for field values.
   * Entity Ids for field values.
   */
  public function getEntityReferenceTargetIds(ContentEntityInterface $entity, $field_name, $sort = FALSE);

  /**
   * Get the description of the Runner Plugin.
   *
   * Usually this will return description from the plugin itself but some runners
   * may need a dynamic description or a long description.
   *
   * @return string
   */
  public function getDescription();

  /**
   * Set wether or not the updates are run by cron.
   *
   * @param bool $run_by_cron
   *  Wether or not the updates are runs by cron.
   */
  public function setRunByCron($run_by_cron);

  /**
   * Get whether or not the updates are run by cron.
   *
   * @return boolean
   *   Whether or not the updates are run by cron.
   */
  public function isRunByCron();

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
UpdateRunnerInterface::addUpdatesToQueue public function Add all updates to queue. 1
UpdateRunnerInterface::AFTER_ARCHIVE constant
UpdateRunnerInterface::AFTER_DELETE constant
UpdateRunnerInterface::getDescription public function Get the description of the Runner Plugin. 1
UpdateRunnerInterface::getEntityReferenceTargetIds public function Get target entity ids for an entity reference field on a entity. 1
UpdateRunnerInterface::getInvalidUpdateBehavior public function Get how this runner should handle invalid entity updates. 1
UpdateRunnerInterface::getQueue public function Get the Queue for this Update Runner. 1
UpdateRunnerInterface::getReferencingFieldIds public function Get all field ids that are attached to the entity type to be updated and target this update type. 1
UpdateRunnerInterface::INVALID_ARCHIVE constant
UpdateRunnerInterface::INVALID_DELETE constant
UpdateRunnerInterface::INVALID_REQUEUE constant
UpdateRunnerInterface::isRunByCron public function Get whether or not the updates are run by cron. 1
UpdateRunnerInterface::REVISIONS_BUNDLE_DEFAULT constant
UpdateRunnerInterface::REVISIONS_NO constant
UpdateRunnerInterface::REVISIONS_YES constant
UpdateRunnerInterface::runUpdatesInQueue public function Run all updates that are in the queue. 1
UpdateRunnerInterface::setRunByCron public function Set wether or not the updates are run by cron. 1
UpdateRunnerInterface::updateEntityType public function Return the entity id of the entity type being updated. 1
UpdateRunnerInterface::USER_OWNER constant
UpdateRunnerInterface::USER_REVISION_OWNER constant
UpdateRunnerInterface::USER_UPDATE_OWNER constant
UpdateRunnerInterface::USER_UPDATE_RUNNER constant