public function getEvents() { $events = array(); $rows = $this->fetchAll($this->select(function (Select $select) { $select->order('created_at DESC'); })); foreach ($rows as $row) { $events[] = Model::fromArray($row); } return $events; }
/** * Index action, list all documents with comments * * @return array */ public function indexAction() { $model = new Event\Collection(); $events = $model->getEvents(); return array('events' => $events); }