Jsor\Doctrine\PostGIS\Event\DBALSchemaEventSubscriber::onSchemaAlterTableAddColumn PHP Method

onSchemaAlterTableAddColumn() public method

public onSchemaAlterTableAddColumn ( Doctrine\DBAL\Event\SchemaAlterTableAddColumnEventArgs $args )
$args Doctrine\DBAL\Event\SchemaAlterTableAddColumnEventArgs
    public function onSchemaAlterTableAddColumn(SchemaAlterTableAddColumnEventArgs $args)
    {
        $column = $args->getColumn();
        if (!$this->isSpatialColumnType($column)) {
            return;
        }
        if ('geometry' !== $column->getType()->getName() || $this->schemaManager->isPostGis2()) {
            return;
        }
        $diff = $args->getTableDiff();
        $table = false !== $diff->newName ? $diff->newName : $diff->name;
        $spatialColumnSqlGenerator = new SpatialColumnSqlGenerator($args->getPlatform());
        $args->addSql($spatialColumnSqlGenerator->getSql($column, $table))->preventDefault();
    }