Completed
Push — master ( b70b78...814e9e )
by Filipe
03:21
created

AbstractRepository::setAdapter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * This file is part of slick/orm package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Orm\Repository;
11
12
use Slick\Database\Adapter\AdapterInterface;
13
use Slick\Orm\Descriptor\EntityDescriptorInterface;
14
15
/**
16
 * Abstract entity Repository
17
 *
18
 * @package Slick\Orm
19
 * @author  Filipe Silva <[email protected]>
20
 */
21
abstract class AbstractRepository
22
{
23
24
    /**
25
     * @var AdapterInterface
26
     */
27
    protected $adapter;
28
29
    /**
30
     * @var EntityDescriptorInterface
31
     */
32
    protected $entityDescriptor;
33
34
    /**
35
     * Sets the adapter for this statement
36
     *
37
     * @param AdapterInterface $adapter
38
     *
39
     * @return $this|self|AbstractRepository
40
     */
41
    public function setAdapter(AdapterInterface $adapter)
42
    {
43
        $this->adapter = $adapter;
44
        return $this;
45
    }
46
47
    /**
48
     * Retrieves the current adapter
49
     *
50
     * @return AdapterInterface
51
     */
52
    public function getAdapter()
53
    {
54
        return $this->adapter;
55
    }
56
57
    /**
58
     * Set the entity descriptor interface
59
     *
60
     * @param EntityDescriptorInterface $descriptor
61
     * @return $this|self|AbstractRepository
62
     */
63
    public function setEntityDescriptor(EntityDescriptorInterface $descriptor)
64
    {
65
        $this->entityDescriptor = $descriptor;
66
        return $this;
67
    }
68
69
    /**
70
     * Gets entity descriptor
71
     *
72
     * @return EntityDescriptorInterface
73
     */
74
    public function getEntityDescriptor()
75
    {
76
        return $this->entityDescriptor;
77
    }
78
79
}