GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SqlSelect::getSource()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * ZfTable ( Module for Zend Framework 2)
4
 *
5
 * @copyright Copyright (c) 2013 Piotr Duda [email protected]
6
 * @license   MIT License
7
 */
8
9
namespace ZfTable\Source;
10
11
use ZfTable\Source\AbstractSource;
12
use Zend\Paginator\Paginator;
13
use Zend\Paginator\Adapter\DbSelect;
14
15
class SqlSelect extends AbstractSource
16
{
17
18
    /**
19
     *
20
     * @var \Zend\Db\Sql\Select
21
     */
22
    protected $quickSearchQuery;
23
24
    /**
25
     *
26
     * @var \Zend\Db\Sql\Select
27
     */
28
    protected $select;
29
30
    /**
31
     *
32
     * @var  \Zend\Paginator\Paginator
33
     */
34
    protected $paginator;
35
36
    /**
37
     *
38
     * @param \Zend\Db\Sql\Select $select
39
     */
40
    public function __construct($select)
41
    {
42
        $this->select = $select;
43
    }
44
45
    /**
46
     *
47
     * @return \Zend\Db\Sql\Select
48
     */
49
    public function getSelect()
50
    {
51
        return $this->select;
52
    }
53
54
    /**
55
     *
56
     * @return \Zend\Db\Sql\Select
57
     */
58
    public function getSource()
59
    {
60
        return $this->select;
61
    }
62
63
    /**
64
     * Return data as PDO statement
65
     *
66
     * not-used
67
     * @return type
68
     */
69
    protected function getDataAsPdoStatement()
70
    {
71
        $statement = $this->getSql()->prepareStatementForSqlObject($this->select);
0 ignored issues
show
Bug introduced by
The method getSql() does not seem to exist on object<ZfTable\Source\SqlSelect>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
72
        return $statement->execute();
73
    }
74
75
    /**
76
     *
77
     * @return \Zend\Paginator\Paginator
78
     */
79
    public function getPaginator()
80
    {
81
        if (!$this->paginator) {
82
            $adapter = new DbSelect($this->getSelect(), $this->getTable()->getAdapter());
83
            $this->paginator = new Paginator($adapter);
84
85
            $this->order();
86
87
            $this->initPaginator();
88
        }
89
        return $this->paginator;
90
    }
91
92
    /**
93
     * Setting ordering
94
     */
95
    protected function order()
96
    {
97
        $column = $this->getParamAdapter()->getColumn();
98
        $order = $this->getParamAdapter()->getOrder();
99
        if ($column) {
100
            $this->select->reset('order');
101
            $this->select->order($column . ' ' . $order);
102
        }
103
    }
104
105
    /*
106
     * Init quick search
107
     */
108
    protected function quickSearch()
109
    {
110
        if ($this->getQuickSearchQuery()) {
0 ignored issues
show
Bug introduced by
The method getQuickSearchQuery() does not exist on ZfTable\Source\SqlSelect. Did you maybe mean quickSearch()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
111
            $where = $this->getQuickSearchQuery()->getRawState('where');
0 ignored issues
show
Bug introduced by
The method getQuickSearchQuery() does not exist on ZfTable\Source\SqlSelect. Did you maybe mean quickSearch()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
112
            $this->select->where($where);
113
        }
114
    }
115
}
116