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 | 56 | public function setConfiguration($configuration) |
|
96 | { |
||
97 | 56 | $this->configuration = $configuration; |
|
98 | 56 | } |
|
99 | |||
100 | /** |
||
101 | * @return string |
||
102 | */ |
||
103 | 56 | public function getConfiguration() |
|
104 | { |
||
105 | 56 | return "doctrine.configuration.{$this->configuration}"; |
|
106 | } |
||
107 | |||
108 | /** |
||
109 | * @param string $eventmanager |
||
110 | */ |
||
111 | 56 | public function setEventmanager($eventmanager) |
|
112 | { |
||
113 | 56 | $this->eventmanager = $eventmanager; |
|
114 | 56 | } |
|
115 | |||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | 56 | public function getEventmanager() |
|
120 | { |
||
121 | 56 | return "doctrine.eventmanager.{$this->eventmanager}"; |
|
122 | } |
||
123 | |||
124 | /** |
||
125 | * @param array $params |
||
126 | */ |
||
127 | 56 | public function setParams($params) |
|
128 | { |
||
129 | 56 | $this->params = $params; |
|
130 | 56 | } |
|
131 | |||
132 | /** |
||
133 | * @return array |
||
134 | */ |
||
135 | 56 | public function getParams() |
|
136 | { |
||
137 | 56 | return $this->params; |
|
138 | } |
||
139 | |||
140 | /** |
||
141 | * @param array $doctrineTypeMappings |
||
142 | * @return \DoctrineORMModule\Options\DBALConnection |
||
143 | */ |
||
144 | public function setDoctrineTypeMappings($doctrineTypeMappings) |
||
145 | { |
||
146 | $this->doctrineTypeMappings = (array) $doctrineTypeMappings; |
||
147 | |||
148 | return $this; |
||
149 | } |
||
150 | |||
151 | /** |
||
152 | * |
||
153 | * @return array |
||
154 | */ |
||
155 | 56 | public function getDoctrineTypeMappings() |
|
156 | { |
||
157 | 56 | return $this->doctrineTypeMappings; |
|
158 | } |
||
159 | |||
160 | /** |
||
161 | * @param array $doctrineCommentedTypes |
||
162 | */ |
||
163 | 2 | public function setDoctrineCommentedTypes(array $doctrineCommentedTypes) |
|
167 | |||
168 | /** |
||
169 | * @return array |
||
170 | */ |
||
171 | 58 | public function getDoctrineCommentedTypes() |
|
175 | |||
176 | /** |
||
177 | * @param null|string $driverClass |
||
178 | */ |
||
179 | 56 | public function setDriverClass($driverClass) |
|
180 | { |
||
181 | 56 | $this->driverClass = $driverClass; |
|
182 | 56 | } |
|
183 | |||
184 | /** |
||
185 | * @return null|string |
||
186 | */ |
||
187 | 56 | public function getDriverClass() |
|
191 | |||
192 | /** |
||
193 | * @param null|\PDO|string $pdo |
||
194 | */ |
||
195 | public function setPdo($pdo) |
||
199 | |||
200 | /** |
||
201 | * @return null|\PDO|string |
||
202 | */ |
||
203 | 56 | public function getPdo() |
|
207 | |||
208 | /** |
||
209 | * @param string $wrapperClass |
||
210 | */ |
||
211 | public function setWrapperClass($wrapperClass) |
||
215 | |||
216 | /** |
||
217 | * @return string |
||
218 | */ |
||
219 | 56 | public function getWrapperClass() |
|
223 | } |
||
224 |