Passed
Push — master ( 057072...a7e5bc )
by Andreas
19:36
created

org_openpsa_qbpager_direct::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * @package org.openpsa.qbpager
4
 */
5
/**
6
 * Pages QB resultsets (uses midgard QB directly)
7
 *
8
 * @package org.openpsa.qbpager
9
 */
10
class org_openpsa_qbpager_direct extends org_openpsa_qbpager
11
{
12 1
    public function __construct(string $classname, string $pager_id)
13
    {
14 1
        $this->initialize($pager_id);
15 1
        $this->_query = new midgard_query_builder($classname);
16 1
    }
17
18 1
    public function execute() : array
19
    {
20 1
        $this->parse_variables();
21 1
        $this->_query->set_limit($this->results_per_page);
22 1
        $this->_query->set_offset($this->_offset);
23
24 1
        return $this->_query->execute();
25
    }
26
}
27