GeoJson\Feature\Feature::getId PHP Method

getId() public method

Return the identifier for this Feature object.
public getId ( ) : mixed
return mixed
    public function getId()
    {
        return $this->id;
    }

Usage Example

Esempio n. 1
0
 public function testSerialization()
 {
     $geometry = $this->getMockGeometry();
     $geometry->expects($this->any())->method('jsonSerialize')->will($this->returnValue('geometry'));
     $properties = array('key' => 'value');
     $id = 'identifier';
     $feature = new Feature($geometry, $properties, $id);
     $expected = array('type' => 'Feature', 'geometry' => 'geometry', 'properties' => $properties, 'id' => 'identifier');
     $this->assertSame('Feature', $feature->getType());
     $this->assertSame($geometry, $feature->getGeometry());
     $this->assertSame($id, $feature->getId());
     $this->assertSame($properties, $feature->getProperties());
     $this->assertSame($expected, $feature->jsonSerialize());
 }