Completed
Push — master ( 3efb43...6ac6c3 )
by Андрей
05:02
created

ManagerRegistryOptions::setProxyInterfaceName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/doctrine
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\Doctrine\Options;
7
8
use Zend\Stdlib\AbstractOptions;
9
use Doctrine\Common\Persistence\Proxy;
10
11
/**
12
 * Class ManagerRegistryOptions
13
 *
14
 * @package Nnx\Doctrine\Options
15
 */
16
class ManagerRegistryOptions extends AbstractOptions
17
{
18
    /**
19
     * Имя соеденений которые можно использовать в \Nnx\Doctrine\ManagerRegistry\ManagerRegistry
20
     *
21
     * @var array
22
     */
23
    protected $connections = [];
24
25
    /**
26
     * Имена ObjectManager's которые можно использовать в \Nnx\Doctrine\ManagerRegistry\ManagerRegistry
27
     *
28
     * @var array
29
     */
30
    protected $objectManagers = [];
31
32
    /**
33
     * Имя соеденения по умолчанию
34
     *
35
     * @var string
36
     */
37
    protected $defaultConnection;
38
39
    /**
40
     * Имя ObjectManager'a по умолчанию
41
     *
42
     * @var string
43
     */
44
    protected $defaultManager;
45
46
    /**
47
     * Имя прокси интерфейса
48
     *
49
     * @var string
50
     */
51
    protected $proxyInterfaceName = Proxy::class;
52
53
    /**
54
     * Возвращает имя соеденений которые можно использовать в \Nnx\Doctrine\ManagerRegistry\ManagerRegistry
55
     *
56
     * @return array
57
     */
58
    public function getConnections()
59
    {
60
        return $this->connections;
61
    }
62
63
    /**
64
     * Устанавливает имя соеденений которые можно использовать в \Nnx\Doctrine\ManagerRegistry\ManagerRegistry
65
     *
66
     * @param array $connections
67
     *
68
     * @return $this
69
     */
70
    public function setConnections(array $connections = [])
71
    {
72
        $this->connections = $connections;
73
74
        return $this;
75
    }
76
77
    /**
78
     * Возвращает имена ObjectManager's которые можно использовать в \Nnx\Doctrine\ManagerRegistry\ManagerRegistry
79
     *
80
     * @return array
81
     */
82
    public function getObjectManagers()
83
    {
84
        return $this->objectManagers;
85
    }
86
87
    /**
88
     * Устанавливает имена ObjectManager's которые можно использовать в \Nnx\Doctrine\ManagerRegistry\ManagerRegistry
89
     *
90
     * @param array $objectManagers
91
     *
92
     * @return $this
93
     */
94
    public function setObjectManagers(array $objectManagers = [])
95
    {
96
        $this->objectManagers = $objectManagers;
97
98
        return $this;
99
    }
100
101
    /**
102
     * Возвращает имя соеденения по умолчанию
103
     *
104
     * @return string
105
     */
106
    public function getDefaultConnection()
107
    {
108
        return $this->defaultConnection;
109
    }
110
111
    /**
112
     * Устанавливает имя соеденения по умолчанию
113
     *
114
     * @param string $defaultConnection
115
     *
116
     * @return $this
117
     */
118
    public function setDefaultConnection($defaultConnection)
119
    {
120
        $this->defaultConnection = (string)$defaultConnection;
121
122
        return $this;
123
    }
124
125
    /**
126
     * Возвращает имя ObjectManager'a по умолчанию
127
     *
128
     * @return string
129
     */
130
    public function getDefaultManager()
131
    {
132
        return $this->defaultManager;
133
    }
134
135
    /**
136
     * Устанавливает имя ObjectManager'a по умолчанию
137
     *
138
     * @param string $defaultManager
139
     *
140
     * @return $this
141
     */
142
    public function setDefaultManager($defaultManager)
143
    {
144
        $this->defaultManager = (string)$defaultManager;
145
146
        return $this;
147
    }
148
149
    /**
150
     * Возвращает имя прокси интерфейса
151
     *
152
     * @return string
153
     */
154
    public function getProxyInterfaceName()
155
    {
156
        return $this->proxyInterfaceName;
157
    }
158
159
    /**
160
     * Устанавливает имя прокси интерфейса
161
     *
162
     * @param string $proxyInterfaceName
163
     *
164
     * @return $this
165
     */
166
    public function setProxyInterfaceName($proxyInterfaceName)
167
    {
168
        $this->proxyInterfaceName = (string)$proxyInterfaceName;
169
170
        return $this;
171
    }
172
}
173