public static function Workflow::getWorkflows in Workflow 7
18 calls to Workflow::getWorkflows()
- Workflow::getWorkflowByName in includes/Entity/Workflow.php
- A Factory function to get Workflow data from the database, and return objects.
This is only called by CRUD functions in workflow.features.inc
More than likely in prep for an import / export action.
Therefore we don't want to fiddle with the…
- Workflow::load in includes/Entity/Workflow.php
- Loads a Workflow object from table {workflows}
Implements a 'Factory' pattern to get Workflow data from the database, and return objects.
The execution of the query instantiates objects and saves them in a static array.
- WorkflowItem::getAllowedValues in includes/Field/WorkflowItem.php
- WorkflowItem::settingsForm in includes/Field/WorkflowItem.php
- workflow_access_features_export_options in workflow_access/workflow_access.features.inc
- Implements hook_features_export_options().
... See full list
File
- includes/Entity/Workflow.php, line 103
- Contains workflow\includes\Entity\Workflow.
Class
- Workflow
- @file
Contains workflow\includes\Entity\Workflow.
Code
public static function getWorkflows($wid = 0, $reset = FALSE) {
if ($reset) {
self::$workflows = array();
}
if ($wid && isset(self::$workflows[$wid])) {
return array(
$wid => self::$workflows[$wid],
);
}
$query = db_select('workflows', 'w');
$query
->leftJoin('workflow_states', 'ws', 'w.wid = ws.wid');
$query
->fields('w');
$query
->addField('ws', 'sid', 'creation_sid');
$query
->condition('ws.sysid', WORKFLOW_CREATION);
$query
->execute()
->fetchAll(PDO::FETCH_CLASS, 'Workflow');
if ($wid > 0) {
$workflow = isset(self::$workflows[$wid]) ? self::$workflows[$wid] : NULL;
return array(
$wid => $workflow,
);
}
else {
return self::$workflows;
}
}