You are here

public static function WorkflowScheduledTransition::load in Workflow 7.2

Same name and namespace in other branches
  1. 7 includes/Entity/WorkflowScheduledTransition.php \WorkflowScheduledTransition::load()

Given a node, get all scheduled transitions for it.

Parameters

string $entity_type:

int $entity_id:

string $field_name: Optional.

Return value

array An array of WorkflowScheduledTransitions.

deprecated: workflow_get_workflow_scheduled_transition_by_nid() --> WorkflowScheduledTransition::load()

3 calls to WorkflowScheduledTransition::load()
WorkflowTransition::execute in includes/Entity/WorkflowTransition.php
Execute a transition (change state of a node).
WorkflowTransitionForm::buildForm in includes/Form/WorkflowTransitionForm.php
_state
workflow_get_workflow_scheduled_transition_by_nid in ./workflow.deprecated.inc
Given a node, get all scheduled transitions for it.

File

includes/Entity/WorkflowScheduledTransition.php, line 48
Contains workflow\includes\Entity\WorkflowScheduledTransition.

Class

WorkflowScheduledTransition
Implements a scheduled transition, as shown on Workflow form.

Code

public static function load($entity_type, $entity_id, $field_name = '', $limit = NULL) {
  if (!$entity_id) {
    return array();
  }
  $query = db_select('workflow_scheduled_transition', 'wst');
  $query
    ->fields('wst');
  $query
    ->condition('entity_type', $entity_type, '=');
  $query
    ->condition('nid', $entity_id, '=');
  if ($field_name !== NULL) {
    $query
      ->condition('field_name', $field_name, '=');
  }
  $query
    ->orderBy('scheduled', 'ASC');
  $query
    ->addTag('workflow_scheduled_transition');
  if ($limit) {
    $query
      ->range(0, $limit);
  }
  $result = $query
    ->execute()
    ->fetchAll(PDO::FETCH_CLASS, 'WorkflowScheduledTransition');
  return $result;
}