/**
* Loads a list of workflow states for the specified parameters, returns an array of Element\WorkflowState elements
*
* @return array
*/
public function load()
{
$workflowStateData = $this->db->fetchAll("SELECT cid, ctype, workflowId FROM element_workflow_state" . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit(), $this->model->getConditionVariables());
$workflowStates = [];
foreach ($workflowStateData as $entry) {
if ($workflowState = Model\Element\WorkflowState::getByPrimary($entry['cid'], $entry['ctype'], $entry['workflowid'])) {
$workflowStates[] = $workflowState;
}
}
$this->model->setWorkflowStates($workflowStates);
return $workflowStates;
}