api de gestion de ticket, basé sur php-crud-api. Le but est de décorrélé les outils de gestion des données, afin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Feature.php 664B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Tqdev\PhpCrudApi\GeoJson;
  3. class Feature implements \JsonSerializable
  4. {
  5. private $id;
  6. private $properties;
  7. private $geometry;
  8. public function __construct($id, array $properties, /*?Geometry*/ $geometry)
  9. {
  10. $this->id = $id;
  11. $this->properties = $properties;
  12. $this->geometry = $geometry;
  13. }
  14. public function serialize()
  15. {
  16. return [
  17. 'type' => 'Feature',
  18. 'id' => $this->id,
  19. 'properties' => $this->properties,
  20. 'geometry' => $this->geometry,
  21. ];
  22. }
  23. public function jsonSerialize()
  24. {
  25. return $this->serialize();
  26. }
  27. }