public function onStatistics($event) { $table = Engine_Api::_()->getDbTable('playlists', 'music'); $select = new Zend_Db_Table_Select($table); $select->from($table->info('name'), array('COUNT(*) AS count')); $event->addResponse($select->query()->fetchColumn(0), 'playlist'); $table = Engine_Api::_()->getDbTable('playlistSongs', 'music'); $select = new Zend_Db_Table_Select($table); $select->from($table->info('name'), array('COUNT(*) AS count')); $event->addResponse($select->query()->fetchColumn(0), 'song'); }
/** * Get a page * * @var int $page * @return array */ public function getPage($page) { $this->_select->limitPage((int) $page, $this->getRowLimit()); return $this->_select->query()->fetchAll(); }