FlexStore::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * soluble-flexstore library
5
 *
6
 * @author    Vanvelthem Sébastien
7
 * @link      https://github.com/belgattitude/soluble-flexstore
8
 * @copyright Copyright (c) 2016-2017 Vanvelthem Sébastien
9
 * @license   MIT License https://github.com/belgattitude/soluble-flexstore/blob/master/LICENSE.md
10
 *
11
 */
12
13
namespace Soluble\FlexStore;
14
15
use Soluble\FlexStore\ResultSet\ResultSet;
16
use Soluble\FlexStore\Store\StoreInterface;
17
18
class FlexStore implements StoreInterface
19
{
20
    /**
21
     * @var Source\SourceInterface
22
     */
23
    protected $source;
24
25
    /**
26
     * @param Source\SourceInterface $source
27
     */
28 41
    public function __construct(Source\SourceInterface $source)
29
    {
30 41
        $this->source = $source;
31 41
    }
32
33
    /**
34
     * Return store search options.
35
     *
36
     * @return Options
37
     */
38 16
    public function getOptions()
39
    {
40 16
        return $this->source->getOptions();
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 2
    public function getSource()
47
    {
48 2
        return $this->source;
49
    }
50
51
    /**
52
     * Return the underlying store data as a resultset.
53
     *
54
     * @throws Exception\EmptyQueryException when query is empty
55
     * @throws Exception\ErrorException      whenever an error occured
56
     *
57
     * @param Options $options
58
     *
59
     * @return ResultSet
60
     */
61 30
    public function getData(Options $options = null)
62
    {
63 30
        return $this->source->getData($options);
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69 12
    public function getColumnModel()
70
    {
71 12
        return $this->source->getColumnModel();
72
    }
73
}
74