You are here

function revision_scheduler_entity_revision_load in Revision scheduler 7

Load a single entity with an optional revision ID.

Parameters

string $entity_type: An entity type.

int $entity_id: An entity ID to load.

int $revision_id: (optional) An entity revision ID to use when loading the entity rather than the latest revision.

Return value

object An entity object from entity_load().

See also

revision_scheduler_entity_revision_load_multiple()

4 calls to revision_scheduler_entity_revision_load()
revision_scheduler_delete_form in ./revision_scheduler.pages.inc
revision_scheduler_operation_access in ./revision_scheduler.module
revision_scheduler_operation_create_access in ./revision_scheduler.module
Load a single entity with an optional revision ID.
revision_scheduler_operation_process in ./revision_scheduler.module
Process a single scheduled revision operation.

File

./revision_scheduler.module, line 286

Code

function revision_scheduler_entity_revision_load($entity_type, $entity_id, $revision_id = NULL) {
  if (empty($revision_id)) {
    $revisions = entity_load($entity_type, array(
      $entity_id,
    ));
  }
  else {
    $revisions = revision_scheduler_entity_revision_load_multiple($entity_type, $entity_id, array(
      $revision_id,
    ));
  }
  return !empty($revisions) ? reset($revisions) : FALSE;
}