public function setSource($source)
{
if (!is_string($source)) {
throw new Grid\GridException("Source of `SqlSource` should be string with SQL query");
}
$this->source = $source;
return $this;
}
/** * init * * @return self */ public function init() { // Setup source $adapter = new SqlSource(); $adapter->setSource('SELECT * FROM musician'); $this->setAdapter($adapter); $this->setDefaultLimit(25); $this->setAllowOrders(['title', 'id', 'created', 'updated']); $this->setAllowFilters(['id', 'nickname', 'image', 'music_type', 'group', 'concert_date']); return $this; }