Jsor\Doctrine\PostGIS\Schema\SchemaManager::listSpatialGeometryColumns PHP Méthode

listSpatialGeometryColumns() public méthode

public listSpatialGeometryColumns ( $table )
    public function listSpatialGeometryColumns($table)
    {
        if (false !== strpos($table, '.')) {
            list(, $table) = explode('.', $table);
        }
        $sql = 'SELECT f_geometry_column
                FROM geometry_columns
                WHERE f_table_name = ?';
        $tableColumns = $this->connection->fetchAll($sql, array($this->trimQuotes($table)));
        $columns = array();
        foreach ($tableColumns as $row) {
            $columns[] = $row['f_geometry_column'];
        }
        return $columns;
    }

Usage Example

 public function onSchemaDropTable(SchemaDropTableEventArgs $args)
 {
     if ($this->schemaManager->isPostGis2()) {
         return;
     }
     $table = $args->getTable();
     $hasSpatialGeometryColumn = count($this->schemaManager->listSpatialGeometryColumns($table->getName())) > 0;
     if ($hasSpatialGeometryColumn) {
         $args->setSql("SELECT DropGeometryTable('" . $table->getName() . "')")->preventDefault();
     }
 }
All Usage Examples Of Jsor\Doctrine\PostGIS\Schema\SchemaManager::listSpatialGeometryColumns