|
@@ 198-209 (lines=12) @@
|
| 195 |
|
* @param string $name |
| 196 |
|
* @param array $types |
| 197 |
|
*/ |
| 198 |
|
private function processDbalTypes($name, array $types) |
| 199 |
|
{ |
| 200 |
|
$builder = $this->getContainerBuilder(); |
| 201 |
|
$connection = $builder->getDefinition($name . '.entityManager'); |
| 202 |
|
|
| 203 |
|
foreach ($types as $type => $className) { |
| 204 |
|
$connection->addSetup( |
| 205 |
|
'if ( ! Doctrine\DBAL\Types\Type::hasType(?)) { Doctrine\DBAL\Types\Type::addType(?, ?); }', |
| 206 |
|
[$type, $type, $className] |
| 207 |
|
); |
| 208 |
|
} |
| 209 |
|
} |
| 210 |
|
|
| 211 |
|
|
| 212 |
|
/** |
|
@@ 216-224 (lines=9) @@
|
| 213 |
|
* @param string $name |
| 214 |
|
* @param array $types |
| 215 |
|
*/ |
| 216 |
|
private function processDbalTypeOverrides($name, array $types) |
| 217 |
|
{ |
| 218 |
|
$builder = $this->getContainerBuilder(); |
| 219 |
|
$entityManagerDefinition = $builder->getDefinition($name . '.entityManager'); |
| 220 |
|
|
| 221 |
|
foreach ($types as $type => $className) { |
| 222 |
|
$entityManagerDefinition->addSetup('Doctrine\DBAL\Types\Type::overrideType(?, ?);', [$type, $className]); |
| 223 |
|
} |
| 224 |
|
} |
| 225 |
|
|
| 226 |
|
|
| 227 |
|
public function afterCompile(ClassType $class) |