Completed
Push — master ( ebe6f0...ba3884 )
by Sébastien
17:24 queued 19s
created

FlexStore::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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