ActivityLog\Model\Event\Collection::getEvents PHP Method

getEvents() public method

Return all documents with Event(s)
public getEvents ( ) : array
return array
    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;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Index action, list all documents with comments
  *
  * @return array
  */
 public function indexAction()
 {
     $model = new Event\Collection();
     $events = $model->getEvents();
     return array('events' => $events);
 }
Collection