<?php
namespace App\Entity\Api;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiFilter;
use Symfony\Component\Serializer\Annotation\Groups;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
/**
* @ORM\Entity(repositoryClass="App\Repository\EventRepository")
* @ApiResource(
* collectionOperations={
* "get": {
* "method": "GET",
* "openapi_context": {
* "responses": {
* "200": {
* "description" : "Event collection",
* "content": {
* "application/json": {
* "schema": {
* "example" : "{""data"": [ { ""id"": 0, ""name"": ""string"", ""content"": ""string"", ""teaser"": ""string"", ""dateFrom"": ""2022-08-10T19:26:53.721Z"", ""dateTo"": ""2022-08-10T19:26:53.721Z"", ""urlLink"": ""string"", ""location"": ""string"", ""organizer"": ""string"", ""phone"": ""string"", ""email"": ""string"", ""published"": 0, ""slug"": ""string"", ""contactPerson"": ""string"", ""icon"": ""string"", ""category"": ""string"", ""site"": [ ""string"" ], ""statistic"": ""string"" } ], ""meta"": {""current_page"": 1,""from"": 0,""to"": 30,""per_page"": ""30"",""last_page"": 8,""total"": 211 }}",
* "type": "object",
* "properties" : {
* "data" : {
* "type": "array",
* "items": {
* "$ref":"#/components/schemas/Event"
* }
*
* },
* "meta": {
* "type": "object",
* "properties": {
* "current_page":{"type": "integer"},
* "from":{"type": "integer"},
* "to":{"type": "integer"},
* "per_page":{"type": "integer"},
* "last_page":{"type": "integer"},
* "total":{"type": "integer"}
* }
*
* }
* }
* }
* }
* },
* },
* },
* },
* },
* },
* itemOperations={"get"}
* )
* @ApiFilter(DateFilter::class, properties={"dateFrom"})
* @ApiFilter(SearchFilter::class, properties={"name":"partial", "slug":"exact","site":"exact"})
* @ApiFilter(OrderFilter::class, properties={"dateFrom"})
*/
class Event {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length=200)
*/
protected $name;
/**
* @ORM\Column(type="text", nullable = true)
*/
protected $content;
/**
* @ORM\Column(type="text", nullable = true)
*/
protected $teaser;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $dateFrom;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $dateTo;
/**
* @ORM\Column(type="string",length=1000, nullable=true)
*/
protected $urlLink;
/**
* @ORM\Column(type="string",length=255, nullable=true)
*/
protected $location;
/**
* @ORM\Column(type="string",length=255, nullable=true)
*/
protected $organizer;
/**
* @ORM\Column(type="string",length=200, nullable=true)
*/
protected $phone;
/**
* @ORM\Column(type="string",length=200, nullable=true)
*/
protected $email;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $published;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
protected $slug;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
protected $contactPerson;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
protected $icon;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
protected $category;
/**
* @ORM\Column(type="array", nullable=true)
*/
protected $site;
protected $statistic;
public function setId($id): self
{
$this->id = $id;
return $this;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getTeaser(): ?string
{
return $this->teaser;
}
public function setTeaser(?string $teaser): self
{
$this->teaser = $teaser;
return $this;
}
public function getDateFrom(): ?\DateTimeInterface
{
return $this->dateFrom;
}
public function setDateFrom(?\DateTimeInterface $date_from): self
{
$this->dateFrom = $date_from;
return $this;
}
public function getDateTo(): ?\DateTimeInterface
{
return $this->dateTo;
}
public function setDateTo(?\DateTimeInterface $date_to): self
{
$this->dateTo = $date_to;
return $this;
}
public function getUrlLink(): ?string
{
return $this->urlLink;
}
public function setUrlLink(?string $url_link): self
{
$this->urlLink = $url_link;
return $this;
}
public function getLocation(): ?string
{
return $this->location;
}
public function setLocation(?string $location): self
{
$this->location = $location;
return $this;
}
public function getOrganizer(): ?string
{
return $this->organizer;
}
public function setOrganizer(?string $organizer): self
{
$this->organizer = $organizer;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getPublished(): ?int
{
return $this->published;
}
public function setPublished(?int $published): self
{
$this->published = $published;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getContactPerson(): ?string
{
return $this->contactPerson;
}
public function setContactPerson(?string $contact_person): self
{
$this->contactPerson = $contact_person;
return $this;
}
public function getIcon(): ?string
{
return $this->icon;
}
public function setIcon(?string $icon): self
{
$this->icon = $icon;
return $this;
}
public function getCategory(): ?string
{
return $this->category;
}
public function setCategory(?string $category): self
{
$this->category = $category;
return $this;
}
/**
* Get the value of site
*/
public function getSite()
{
return $this->site;
}
/**
* Set the value of site
*
* @return self
*/
public function setSite($site)
{
$this->site = $site;
return $this;
}
/**
* Get the value of statistic
*/
public function getStatistic()
{
return $this->statistic;
}
/**
* Set the value of statistic
*
* @return self
*/
public function setStatistic($statistic)
{
$this->statistic = $statistic;
return $this;
}
}