abstract class Repository {
protected $model = FALSE;
public function get($select = '*',$take = FALSE,$pagination = FALSE, $where = FALSE,$orderBy=FALSE) {
$builder = $this->model->select($select);
if($take) {
$builder->take($take);
}
if($where) {
$builder->where($where[0],$where[1]);
}
if($orderBy){
$builder->orderBy('id','DESC');
}
if($pagination) {
return $builder->paginate(Config::get('settings.paginate_home'));
}
return $builder->get();
}
}
public function __construct(ArticlesRepository $a_rep) {
parent::__construct();
$this->a_rep=$a_rep;
$this->title='Jibi.ru |sssss';
$this->keywords='Jibi.ru|';
$this->meta_desc='Jibi.ru |';
}
//
public function index(){
$articles=$this->getArticles('*',FALSE,TRUE);
$LastArticles=$this->getArticles('*',8,FALSE,false,TRUE);
}