src/Entity/SiteSeo.php line 81
<?phpnamespace App\Entity;use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;use ApiPlatform\Metadata\ApiFilter;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Delete;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\GetCollection;use ApiPlatform\Metadata\Patch;use ApiPlatform\Metadata\Post;use ApiPlatform\Metadata\Put;use ApiPlatform\Serializer\Filter\PropertyFilter;use App\Repository\SiteSeoRepository;use DateTimeImmutable;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints as Assert;use App\Filter\SearchAnnotation as Searchable;#[ORM\Entity(repositoryClass: SiteSeoRepository::class)]#[ApiFilter(PropertyFilter::class)]#[ApiResource(shortName: 'Site Seo',description: 'Studio API',operations: [new Get(uriTemplate: '/seo/{id}'),new Patch(uriTemplate: '/seo/{id}',security: "is_granted('ROLE_OAUTH2_BASIC')"),new Put(uriTemplate: '/seo/{id}',security: "is_granted('ROLE_OAUTH2_BASIC')"),new Post(uriTemplate: '/seo',security: "is_granted('ROLE_OAUTH2_BASIC')"),new Delete(uriTemplate: '/seo/{id}',security: "is_granted('ROLE_OAUTH2_BASIC')"),new GetCollection(uriTemplate: '/seo', paginationEnabled: false),],formats: ['jsonld','json','jsonhal','csv' => 'text/csv',],normalizationContext: ['groups' => ['seo:read'],],denormalizationContext: ['groups' => ['seo:write'],],filters:['search'],// paginationItemsPerPage: 10,),ApiFilter(OrderFilter::class,properties: ['type','slug','seoTitle','noIndex','noFollow','fbAktiv','xAktiv','createdAt',],),ApiFilter(SearchFilter::class,properties: [//'seoContent',// 'seoTitle',],),]/*** @Searchable({"seoContent", "seoTitle", "ogType", "ogTitle", "ogContent", "xType", "xSite", "xCreator"})*/class SiteSeo{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['seo:read', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]private ?int $id = null;#[ORM\Column(length: 28)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]#[Assert\NotBlank]#[Assert\Length(min: 1, max: 28, maxMessage: 'Describe your loot in 1-28 chars or less')]// #[ApiFilter(RegexpFilter::class)]//http://example.com/offers?regexp_type=^[FOO]private ?string $type = null;#[ORM\Column(length: 64, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]private ?string $slug = null;#[ORM\Column(type: Types::TEXT, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'search')]private ?string $seoContent = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'search')]private ?string $seoTitle = null;#[ORM\OneToOne(mappedBy: 'siteSeo', targetEntity: Studio::class)]#[Groups(['seo:read','seo:write'])]protected ?Studio $studio;#[ORM\Column]private ?DateTimeImmutable $createdAt = null;#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ORM\Column]private ?bool $noIndex = null;#[ORM\Column]#[Groups(['seo:read', 'seo:write', 'studio:read'])]private ?bool $noFollow = null;#[ORM\Column]#[Groups(['seo:read', 'seo:write', 'studio:read'])]private ?bool $fbAktiv = null;#[ORM\Column]#[Groups(['seo:read', 'seo:write', 'studio:read'])]private ?bool $xAktiv = null;#[ORM\Column(length: 64, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]private ?string $ogType = null;#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ORM\Column(length: 255, nullable: true)]#[ApiFilter(SearchFilter::class, strategy: 'partial')]private ?string $ogTitle = null;#[ORM\Column(type: Types::TEXT, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'partial')]private ?string $ogContent = null;#[ORM\Column(nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]private ?int $ogImage = null;#[ORM\Column(length: 64, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]private ?string $xType = null;#[ORM\Column(length: 64, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'partial')]private ?string $xSite = null;#[ORM\Column(length: 64, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]#[ApiFilter(SearchFilter::class, strategy: 'partial')]private ?string $xCreator = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]private ?string $fbAppId = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]private ?string $fbAdmins = null;#[ORM\Column(length: 6, nullable: true, options: ['default' => ' – '])]#[Groups(['seo:read', 'seo:write', 'studio:read'])]private ?string $seoSeparator = null;#[ORM\Column(length: 64, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]private ?string $titlePrefix = null;#[ORM\Column(length: 64, nullable: true)]#[Groups(['seo:read', 'seo:write', 'studio:read'])]private ?string $titleSuffix = null;public function __construct(){$this->createdAt = new DateTimeImmutable();$this->noIndex = false;$this->noFollow = false;$this->fbAktiv = false;$this->xAktiv = false;$this->ogType = 'website';$this->xType = 'summary';}public function getId(): ?int{return $this->id;}public function getType(): ?string{return $this->type;}public function setType(string $type): self{$this->type = $type;return $this;}public function getSlug(): ?string{return $this->slug;}public function setSlug(string $slug): self{$this->slug = $slug;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->setSiteSeo(null);}// set the owning side of the relation if necessaryif ($studio !== null && $studio->getSiteSeo() !== $this) {$studio->setSiteSeo($this);}$this->studio = $studio;return $this;}public function getCreatedAt(): ?DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}#[Groups(['seo:read'])]public function getSeoOrderCreatedAt(): ?DateTimeImmutable{return $this->createdAt;}public function getSeoTitle(): ?string{return $this->seoTitle;}public function setSeoTitle(string $seoTitle): self{$this->seoTitle = $seoTitle;return $this;}public function getSeoContent(): ?string{return $this->seoContent;}public function setSeoContent(?string $seoContent): self{$this->seoContent = $seoContent;return $this;}public function isNoIndex(): ?bool{return $this->noIndex;}public function setNoIndex(bool $noIndex): self{$this->noIndex = $noIndex;return $this;}public function isNoFollow(): ?bool{return $this->noFollow;}public function setNoFollow(bool $noFollow): self{$this->noFollow = $noFollow;return $this;}public function isFbAktiv(): ?bool{return $this->fbAktiv;}public function setFbAktiv(bool $fbAktiv): self{$this->fbAktiv = $fbAktiv;return $this;}public function isXAktiv(): ?bool{return $this->xAktiv;}public function setXAktiv(bool $xAktiv): self{$this->xAktiv = $xAktiv;return $this;}public function getOgType(): ?string{return $this->ogType;}public function setOgType(?string $ogType): self{$this->ogType = $ogType;return $this;}public function getXType(): ?string{return $this->xType;}public function setXType(?string $xType): self{$this->xType = $xType;return $this;}public function getXSite(): ?string{return $this->xSite;}public function setXSite(?string $xSite): self{$this->xSite = $xSite;return $this;}public function getXCreator(): ?string{return $this->xCreator;}public function setXCreator(?string $xCreator): self{$this->xCreator = $xCreator;return $this;}public function getOgTitle(): ?string{return $this->ogTitle;}public function setOgTitle(?string $ogTitle): self{$this->ogTitle = $ogTitle;return $this;}public function getOgContent(): ?string{return $this->ogContent;}public function setOgContent(?string $ogContent): self{$this->ogContent = $ogContent;return $this;}public function getOgImage(): ?int{return $this->ogImage;}public function setOgImage(?int $ogImage): self{$this->ogImage = $ogImage;return $this;}public function getFbAppId(): ?string{return $this->fbAppId;}public function setFbAppId(?string $fbAppId): self{$this->fbAppId = $fbAppId;return $this;}public function getFbAdmins(): ?string{return $this->fbAdmins;}public function setFbAdmins(?string $fbAdmins): self{$this->fbAdmins = $fbAdmins;return $this;}public function getSeoSeparator(): ?string{return $this->seoSeparator;}public function setSeoSeparator(?string $seoSeparator): self{$this->seoSeparator = $seoSeparator;return $this;}public function getTitlePrefix(): ?string{return $this->titlePrefix;}public function setTitlePrefix(?string $titlePrefix): self{$this->titlePrefix = $titlePrefix;return $this;}public function getTitleSuffix(): ?string{return $this->titleSuffix;}public function setTitleSuffix(?string $titleSuffix): self{$this->titleSuffix = $titleSuffix;return $this;}}