33     abstract protected function getFromPart(array $params, array $filter): string;
    35     abstract protected function getWherePart(array $params, array $filter): string;
    37     abstract protected function getGroupByPart(array $params, array $filter): string;
    39     abstract protected function getHavingPart(array $params, array $filter): string;
    41     abstract protected function getOrderByPart(array $params, array $filter): string;
    46     public function getList(array $params, array $filter): array
    60         if (isset($params[
'limit'])) {
    61             if (!is_numeric($params[
'limit'])) {
    65             if (!isset($params[
'offset'])) {
    66                 $params[
'offset'] = 0;
    68                 if (!is_numeric($params[
'offset'])) {
    73             $this->db->setLimit($params[
'limit'], $params[
'offset']);
    76         $where = strlen($where) ? 
'WHERE ' . $where : 
'';
    77         $query = 
"SELECT {$select} FROM {$from} {$where}";
    80             $query .= 
" GROUP BY {$group}";
    83         if (strlen($having)) {
    84             $query .= 
" HAVING {$having}";
    88             $query .= 
" ORDER BY {$order}";
    91         $res = $this->db->query($query);
    92         while ($row = $this->db->fetchAssoc(
$res)) {
    93             $data[
'items'][] = $row;
    96         if (isset($params[
'limit'])) {
    97             $cnt_sql = 
"SELECT COUNT(*) cnt FROM ({$query}) subquery";
    98             $row_cnt = $this->db->fetchAssoc($this->db->query($cnt_sql));
    99             $data[
'cnt'] = $row_cnt[
'cnt'];
 
getHavingPart(array $params, array $filter)
 
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
 
getSelectPart(array $params, array $filter)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getOrderByPart(array $params, array $filter)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getWherePart(array $params, array $filter)
 
getList(array $params, array $filter)
 
getFromPart(array $params, array $filter)
 
getGroupByPart(array $params, array $filter)
 
__construct(ilDBInterface $db)