Jsor\Doctrine\PostGIS\Schema\SchemaManager::getGeographySpatialColumnInfo PHP Method

getGeographySpatialColumnInfo() public method

public getGeographySpatialColumnInfo ( $table, $column )
    public function getGeographySpatialColumnInfo($table, $column)
    {
        if (false !== strpos($table, '.')) {
            list(, $table) = explode('.', $table);
        }
        $sql = 'SELECT coord_dimension, srid, type
                FROM geography_columns
                WHERE f_table_name = ?
                AND f_geography_column = ?';
        $row = $this->connection->fetchAssoc($sql, array($this->trimQuotes($table), $this->trimQuotes($column)));
        if (!$row) {
            return null;
        }
        return $this->buildSpatialColumnInfo($row);
    }

Usage Example

コード例 #1
0
 public function testGetGeographySpatialColumnInfo()
 {
     $schemaManager = new SchemaManager($this->_getConnection());
     $this->assertNull($schemaManager->getGeographySpatialColumnInfo('foo.points', 'text'));
     $expected = array('type' => 'GEOMETRY', 'srid' => 4326);
     $this->assertEquals($expected, $schemaManager->getGeographySpatialColumnInfo('points', 'geography'));
     $expected = array('type' => 'POINT', 'srid' => 4326);
     $this->assertEquals($expected, $schemaManager->getGeographySpatialColumnInfo('points', 'point_geography_2d'));
     $expected = array('type' => 'POINT', 'srid' => 4326);
     $this->assertEquals($expected, $schemaManager->getGeographySpatialColumnInfo('points', 'point_geography_2d_srid'));
 }
All Usage Examples Of Jsor\Doctrine\PostGIS\Schema\SchemaManager::getGeographySpatialColumnInfo