/** * Visitors controller index action */ public function indexAction() { $this->breadcrumbsBlock->addBreadcrumb('Visitors', 'admin/visitors'); $collection = \Magelight\Db\Collection::forge(\Magelight\Visitors\Models\Visitor::orm()->orderByDesc('time'))->setLimit(30); $page = $this->request()->getRequest('page', 0); $this->view()->sectionReplace('content', \Magelight\Visitors\Blocks\VisitorsList::forge($collection, $page)); $this->renderView(); }
/** * Get entity collection * * @return \Magelight\Db\Collection */ public function getCollection() { return \Magelight\Db\Collection::forge($this->scaffold->getEntityModel($this->entity)->getOrm())->setLimit(10)->setPage($this->page); }
/** * Get models flat collection * * @return Db\Collection */ public static function getFlatCollection() { return \Magelight\Db\Collection::forge(static::callStaticLate('orm')); }