src/Entity/EmailTemplates.php line 53
<?phpnamespace App\Entity;use ApiPlatform\Doctrine\Common\Filter\SearchFilterInterface;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\Serializer\Filter\PropertyFilter;use App\AppHelper\Helper;use App\Repository\EmailTemplatesRepository;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 Carbon\Carbon;use function Symfony\Component\String\u;#[ORM\Entity(repositoryClass: EmailTemplatesRepository::class)]/*#[ApiFilter(PropertyFilter::class)]#[ApiResource(shortName: 'E-Mail-Templates',description: 'App E-Mail Templates.',operations: [new Get(uriTemplate: '/email-template/{id}'),new GetCollection(uriTemplate: '/email-template'),new Post(uriTemplate: '/email-template'),new Patch(uriTemplate: '/email-template/{id}'),new Delete(uriTemplate: '/email-template/{id}')],formats: ['jsonld','json','jsonhal','html','csv' => 'text/csv',],normalizationContext: ['groups' => ['template:read'],],denormalizationContext: ['groups' => ['template:write'],],paginationItemsPerPage: 10)]*/class EmailTemplates{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]// #[Groups(['template:read'])]private ?int $id = null;#[ORM\Column(length: 64)]// #[Groups(['template:read', 'template:write'])]// #[ApiFilter(SearchFilter::class, strategy: 'exact')]#[Assert\NotBlank]private ?string $type = null;#[ORM\Column(nullable: true)]private ?int $system_type = null;#[ORM\Column(length: 255)]// #[Groups(['template:read', 'template:write'])]// #[ApiFilter(SearchFilter::class, strategy: 'partial')]#[Assert\NotBlank]private ?string $subject = null;#[ORM\Column(nullable: true, options: ['default' => 0] )]private ?int $position = null;#[ORM\Column(type: Types::TEXT, length: 255)]#[Groups(['template:read', 'template:write'])]#[Assert\NotBlank]private ?string $bezeichnung = null;#[ORM\Column(type: Types::TEXT , options: ['default' => 'no content'])]#[Groups(['template:write'])]#[Assert\NotBlank]#[Assert\Length(min: 6, minMessage: 'There must be at least 6 characters.')]private ?string $content = null;#[ORM\Column]#[Groups(['template:read'])]private ?DateTimeImmutable $created_at = null;public function __construct(){$this->created_at = new DateTimeImmutable();}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 getSystemType(): ?int{return $this->system_type;}public function setSystemType(?int $system_type): self{$this->system_type = $system_type;return $this;}public function getSubject(): ?string{return $this->subject;}public function setSubject(string $subject): self{$this->subject = $subject;return $this;}public function getPosition(): ?int{return $this->position;}public function setPosition(?int $position): self{$this->position = $position;return $this;}public function getBezeichnung(): ?string{return $this->bezeichnung;}public function setBezeichnung(string $bezeichnung): self{$this->bezeichnung = $bezeichnung;return $this;}public function getContent(): ?string{return $this->content;}#[Groups(['template:read'])]public function getContentFormat(): ?string{return html_entity_decode($this->content);}public function setContent(string $content): self{$this->content = $content;return $this;}public function getCreatedAt(): ?DateTimeImmutable{return $this->created_at;}#[Groups(['template:read'])]public function getCreatedFormat(): ?string{return $this->created_at->format('Y-m-d H:i:s');}public function setCreatedAt(DateTimeImmutable $created_at): self{$this->created_at = $created_at;return $this;}}