src/Entity/GeoData.php line 42
<?phpnamespace App\Entity;use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;use ApiPlatform\Metadata\ApiFilter;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\GetCollection;use ApiPlatform\Serializer\Filter\PropertyFilter;use App\Repository\GeoDataRepository;use DateTimeImmutable;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: GeoDataRepository::class)]#[ApiFilter(PropertyFilter::class)]/*#[ApiResource(shortName: 'Studio Geo',description: 'Api Studio Geodaten.',operations: [new Get(uriTemplate: '/studio-geo/{id}'),new GetCollection(uriTemplate: '/studio-geo', paginationEnabled: false),//new Post(uriTemplate: '/set-media-category'),//new Patch(uriTemplate: '/update-media-category/{id}'),],formats: ['jsonld','json','jsonhal','csv' => 'text/csv',],normalizationContext: ['groups' => ['geo:read'],],denormalizationContext: ['groups' => ['geo:write'],],//paginationItemsPerPage: 10,)]*/class GeoData{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['geo:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private ?string $geoLon = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private ?string $geoLat = null;#[ORM\Column(nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private array $geoJson = [];#[Groups(['geo:read'])]#[ORM\OneToOne(mappedBy: 'geodaten', targetEntity: Studio::class)]protected Studio $studio;#[ORM\Column]private ?DateTimeImmutable $createdAt = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private ?string $displayName = null;#[ORM\Column(nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private array $boundingBox = [];#[ORM\Column(length: 255, nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private ?string $importance = null;#[ORM\Column(nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private ?string $osmId = null;#[ORM\Column(nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private ?string $placeId = null;#[ORM\Column(length: 64, nullable: true)]#[Groups(['geo:read' ,'studio:read'])]private ?string $osmType = null;public function __construct(){$this->createdAt = new DateTimeImmutable();}public function getId(): ?int{return $this->id;}public function getGeoLon(): ?string{return $this->geoLon;}public function setGeoLon(?string $geoLon): self{$this->geoLon = $geoLon;return $this;}public function getGeoLat(): ?string{return $this->geoLat;}public function setGeoLat(?string $geoLat): self{$this->geoLat = $geoLat;return $this;}public function getGeoJson(): array{return $this->geoJson;}public function setGeoJson(?array $geoJson): self{$this->geoJson = $geoJson;return $this;}public function getCreatedAt(): ?DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}public function getStudio(): ?Studio{return $this->studio;}public function setStudio(?Studio $studio): self{// unset the owning side of the relation if necessaryif ($studio === null && $this->studio !== null) {$this->studio->setGeodaten(null);}// set the owning side of the relation if necessaryif ($studio !== null && $studio->getGeodaten() !== $this) {$studio->setGeodaten($this);}$this->studio = $studio;return $this;}public function getDisplayName(): ?string{return $this->displayName;}public function setDisplayName(?string $displayName): self{$this->displayName = $displayName;return $this;}public function getBoundingBox(): array{return $this->boundingBox;}public function setBoundingBox(?array $boundingBox): self{$this->boundingBox = $boundingBox;return $this;}public function getImportance(): ?string{return $this->importance;}public function setImportance(?string $importance): self{$this->importance = $importance;return $this;}public function getOsmId(): ?string{return $this->osmId;}public function setOsmId(?string $osmId): self{$this->osmId = $osmId;return $this;}public function getPlaceId(): ?string{return $this->placeId;}public function setPlaceId(string $placeId): self{$this->placeId = $placeId;return $this;}public function getOsmType(): ?string{return $this->osmType;}public function setOsmType(?string $osmType): self{$this->osmType = $osmType;return $this;}}