1 | <?php |
||
31 | class DBALConnection extends AbstractOptions |
||
32 | { |
||
33 | /** |
||
34 | * Set the configuration key for the Configuration. Configuration key |
||
35 | * is assembled as "doctrine.configuration.{key}" and pulled from |
||
36 | * service locator. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $configuration = 'orm_default'; |
||
41 | |||
42 | /** |
||
43 | * Set the eventmanager key for the EventManager. EventManager key |
||
44 | * is assembled as "doctrine.eventmanager.{key}" and pulled from |
||
45 | * service locator. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $eventmanager = 'orm_default'; |
||
50 | |||
51 | /** |
||
52 | * Set the PDO instance, if any, to use. If a string is set |
||
53 | * then the alias is pulled from the service locator. |
||
54 | * |
||
55 | * @var null|string|\PDO |
||
56 | */ |
||
57 | protected $pdo = null; |
||
58 | |||
59 | /** |
||
60 | * Setting the driver is deprecated. You should set the |
||
61 | * driver class directly instead. |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $driverClass = 'Doctrine\DBAL\Driver\PDOMySql\Driver'; |
||
66 | |||
67 | /** |
||
68 | * Set the wrapper class for the driver. In general, this should not |
||
69 | * need to be changed. |
||
70 | * |
||
71 | * @var string|null |
||
72 | */ |
||
73 | protected $wrapperClass = null; |
||
74 | |||
75 | /** |
||
76 | * Driver specific connection parameters. |
||
77 | * |
||
78 | * @var array |
||
79 | */ |
||
80 | protected $params = array(); |
||
81 | |||
82 | /** |
||
83 | * @var array |
||
84 | */ |
||
85 | protected $doctrineTypeMappings = array(); |
||
86 | |||
87 | /** |
||
88 | * @var array |
||
89 | */ |
||
90 | protected $doctrineCommentedTypes = array(); |
||
91 | |||
92 | /** |
||
93 | * @param string $configuration |
||
94 | */ |
||
95 | public function setConfiguration($configuration) |
||
96 | { |
||
97 | $this->configuration = $configuration; |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * @return string |
||
102 | */ |
||
103 | public function getConfiguration() |
||
104 | { |
||
105 | return "doctrine.configuration.{$this->configuration}"; |
||
106 | } |
||
107 | |||
108 | /** |
||
109 | * @param string $eventmanager |
||
110 | */ |
||
111 | public function setEventmanager($eventmanager) |
||
112 | { |
||
113 | $this->eventmanager = $eventmanager; |
||
114 | } |
||
115 | |||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getEventmanager() |
||
120 | { |
||
121 | return "doctrine.eventmanager.{$this->eventmanager}"; |
||
122 | } |
||
123 | |||
124 | /** |
||
125 | * @param array $params |
||
126 | */ |
||
127 | public function setParams($params) |
||
128 | { |
||
129 | $this->params = $params; |
||
130 | } |
||
131 | |||
132 | /** |
||
133 | * @return array |
||
134 | */ |
||
135 | public function getParams() |
||
136 | { |
||
137 | return $this->params; |
||
138 | } |
||
139 | |||
140 | /** |
||
141 | * @param array $doctrineTypeMappings |
||
142 | * @return \DoctrineORMModule\Options\DBALConnection |
||
143 | */ |
||
144 | public function setDoctrineTypeMappings($doctrineTypeMappings) |
||
150 | |||
151 | /** |
||
152 | * |
||
153 | * @return array |
||
154 | */ |
||
155 | public function getDoctrineTypeMappings() |
||
156 | { |
||
157 | return $this->doctrineTypeMappings; |
||
158 | } |
||
159 | |||
160 | /** |
||
161 | * @param array $doctrineCommentedTypes |
||
162 | */ |
||
163 | 2 | public function setDoctrineCommentedTypes(array $doctrineCommentedTypes) |
|
164 | { |
||
165 | 2 | $this->doctrineCommentedTypes = $doctrineCommentedTypes; |
|
166 | 2 | } |
|
167 | |||
168 | /** |
||
169 | * @return array |
||
170 | */ |
||
171 | 2 | public function getDoctrineCommentedTypes() |
|
172 | { |
||
173 | 2 | return $this->doctrineCommentedTypes; |
|
174 | } |
||
175 | |||
176 | /** |
||
177 | * @param null|string $driverClass |
||
178 | */ |
||
179 | public function setDriverClass($driverClass) |
||
180 | { |
||
181 | $this->driverClass = $driverClass; |
||
182 | } |
||
183 | |||
184 | /** |
||
185 | * @return null|string |
||
186 | */ |
||
187 | public function getDriverClass() |
||
188 | { |
||
189 | return $this->driverClass; |
||
190 | } |
||
191 | |||
192 | /** |
||
193 | * @param null|\PDO|string $pdo |
||
194 | */ |
||
195 | public function setPdo($pdo) |
||
199 | |||
200 | /** |
||
201 | * @return null|\PDO|string |
||
202 | */ |
||
203 | public function getPdo() |
||
204 | { |
||
205 | return $this->pdo; |
||
206 | } |
||
207 | |||
208 | /** |
||
209 | * @param string $wrapperClass |
||
210 | */ |
||
211 | public function setWrapperClass($wrapperClass) |
||
215 | |||
216 | /** |
||
217 | * @return string |
||
218 | */ |
||
219 | public function getWrapperClass() |
||
220 | { |
||
221 | return $this->wrapperClass; |
||
222 | } |
||
223 | } |
||
224 |