Completed
Push — master ( 7e8e79...1f43e8 )
by Hung
02:20 queued 20s
created

ResultSet::make()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A ResultSet::getResultObject() 0 4 1
1
<?php
2
3
namespace Foolz\SphinxQL\Drivers\Mysqli;
4
5
use Foolz\SphinxQL\Exception\ConnectionException;
6
use Foolz\SphinxQL\Drivers\ResultSetBase;
7
8
class ResultSet extends ResultSetBase
9
{
10
    /**
11
     * @var Connection
12
     */
13
    protected $connection;
14
15
    /**
16
     * @var \mysqli_result
17
     */
18
    protected $result;
19
20
    /**
21
     * @param Connection $connection
22
     * @param null|\mysqli_result $result
23
     */
24
    public function __construct(Connection $connection, $result = null)
25
    {
26
        $this->connection = $connection;
27
        $this->adapter = new ResultSetAdapter($connection, $result);
28
        $this->result = $result;
29
        $this->init();
30
    }
31
32
    /**
33
     * Get the result object returned by PHP's MySQLi
34
     *
35
     * @return \mysqli_result
36
     *
37
     * @codeCoverageIgnore
38
     */
39
    public function getResultObject()
40
    {
41
        return $this->result;
42
    }
43
44
    /**
45
     * Get the MySQLi connection wrapper object
46
     *
47
     * @return Connection
48
     *
49
     * @codeCoverageIgnore
50
     */
51
    public function getConnection()
52
    {
53
        return $this->connection;
54
    }
55
56
    /**
57
     * Get the PHP MySQLi object
58
     *
59
     * @return \mysqli
60
     * @throws ConnectionException
61
     */
62
    public function getMysqliConnection()
63
    {
64
        return $this->connection->getConnection();
65
    }
66
}
67