public function getOutcomeData($json = true) { $res = array(); foreach ($this->outcome_queues as $q) { $res[] = array('id' => $q->id, 'name' => $q->name); } if ($json) { return \CJSON::encode($res); } return $res; }