AbstractDataSource::setPaginatorAdapter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace AtDataGrid\DataSource;
4
5
use Zend\EventManager\EventManagerAwareTrait;
6
use Zend\Paginator\Adapter\AdapterInterface;
7
8
abstract class AbstractDataSource implements DataSourceInterface
9
{
10
    use EventManagerAwareTrait;
11
12
    const EVENT_DATASOURCE_PREPARE_POST = 'at-datagrid.datasource.prepare.post';
13
14
    /**
15
     * @var string
16
     */
17
    protected $identifierFieldName = 'id';
18
19
    /**
20
     * @var AdapterInterface
21
     */
22
    protected $paginatorAdapter;
23
24
    /**
25
     * @param $name
26
     */
27
    public function setIdentifierFieldName($name)
28
    {
29
        $this->identifierFieldName = $name;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getIdentifierFieldName()
36
    {
37
        return $this->identifierFieldName;
38
    }
39
40
    /**
41
     * @param AdapterInterface $adapter
42
     */
43
    public function setPaginatorAdapter(AdapterInterface $adapter)
44
    {
45
        $this->paginatorAdapter = $adapter;
46
    }
47
48
    /**
49
     * @return AdapterInterface
50
     */
51
    public function getPaginatorAdapter()
52
    {
53
        return $this->paginatorAdapter;
54
    }
55
}