Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
9 | 40 | public function __construct($pdo, $database = '', $tablePrefix = '', array $config = []) |
|
10 | { |
||
11 | 40 | parent::__construct($pdo, $database, $tablePrefix, $config); |
|
12 | 40 | if (class_exists(Type::class)) { |
|
13 | // Prevent geometry type fields from throwing a 'type not found' error when changing them |
||
14 | $geometries = [ |
||
15 | 40 | 'geometry', |
|
16 | 'point', |
||
17 | 'linestring', |
||
18 | 'polygon', |
||
19 | 'multipoint', |
||
20 | 'multilinestring', |
||
21 | 'multipolygon', |
||
22 | 'geomcollection', |
||
23 | 'geometrycollection', |
||
24 | ]; |
||
25 | 40 | $dbPlatform = $this->getDoctrineSchemaManager()->getDatabasePlatform(); |
|
26 | 40 | foreach ($geometries as $type) { |
|
27 | 40 | $dbPlatform->registerDoctrineTypeMapping($type, 'string'); |
|
28 | } |
||
51 |