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

org_openpsa_qbpager_direct   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 1
A __construct() 0 4 1
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