/** * init * * @return self */ public function init() { // Array $adapter = new \Bluz\Grid\Source\SqlSource(); $adapter->setSource('SELECT * FROM options'); $this->setAdapter($adapter); $this->setDefaultLimit(25); $this->setAllowOrders(['id', 'key', 'namespace', 'value', 'created', 'deleted']); return $this; }
/** * init * * @return self */ public function init() { // Array $adapter = new \Bluz\Grid\Source\SqlSource(); $adapter->setSource('SELECT * FROM test'); $this->setAdapter($adapter); $this->setDefaultLimit(15); $this->setAllowOrders(['name', 'id', 'status']); $this->setAllowFilters(['status', 'id']); $this->setDefaultOrder('name', Grid::ORDER_DESC); return $this; }
/** * init * * @return self */ public function init() { // Array $adapter = new \Bluz\Grid\Source\SqlSource(); $adapter->setSource(' SELECT m.*, u.login FROM media m LEFT JOIN users u ON u.id = m.userId '); $this->setAdapter($adapter); $this->setDefaultLimit(25); $this->setAllowOrders(['id', 'login', 'title', 'type', 'created', 'deleted']); $this->setAllowFilters(['userId', 'title', 'file']); return $this; }