public function prepare($db) { $this->paging = Paging::getFromUrl(); $this->paging->limit = $this->page_size; Paging::$max_pages_links = $this->max_pages_links; $this->search = isset($_GET['s']) ? $_GET['s'] : ''; // add filtering logic here $this->data = ModelBase::select($db, $this->name, $this->where, $this->bindings, $this->types, $this->paging, $this->orderby); }