Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class DataProvider
- {
- protected $table;
- protected $alias;
- protected $query;
- protected $filters = [];
- public function __construct()
- {
- if (empty($this->alias)) {
- $this->alias = $this->table;
- }
- $query = DB::table(sprintf('%s as %s', $this->table, $this->alias));
- $query->select(sprintf('%s.*', $this->alias));
- $this->modifyQueryBuilder($query);
- $this->query = $query;
- }
- public function getQuery()
- {
- return $this->query;
- }
- public function modifyQueryBuilder(&$query)
- {
- }
- public function getData()
- {
- return $this->getQuery()->get();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement