public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $args) { $table = $args->getClassTable(); foreach ($table->getColumns() as $column) { if (!$this->isSpatialColumnType($column)) { continue; } $normalized = $column->getType()->getNormalizedPostGISColumnOptions($column->getCustomSchemaOptions()); foreach ($normalized as $name => $value) { $column->setCustomSchemaOption($name, $value); } } // Add spatial flags to indexes if ($table->hasOption('spatial_indexes')) { foreach ((array) $table->getOption('spatial_indexes') as $indexName) { if (!$table->hasIndex($indexName)) { continue; } $table->getIndex($indexName)->addFlag('spatial'); } } }