src/Entity/ErrorReportSubmission.php line 32
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM,
Doctrine\DBAL\Types\Types;
use Symfony\Component\Serializer\Annotation\Groups,
Symfony\Component\Validator\Constraints as Assert;
use ApiPlatform\Metadata\ApiResource,
ApiPlatform\Metadata\ApiProperty,
ApiPlatform\Metadata\Get,
ApiPlatform\Metadata\GetCollection;
use App\Entity\Trait\IdTrait,
App\Entity\Trait\UuidTrait,
App\Entity\Trait\TimestampableTrait,
App\Repository\ErrorReportSubmissionRepository;
#[ApiResource(
description: 'Error report submissions',
normalizationContext: ['groups' => ['read', 'read:' . self::class]],
security: 'is_granted("' . self::class . '")',
order: ['createdAt' => 'desc'],
operations: [
new GetCollection(),
new Get(),
],
extraProperties: ['standard_put' => false],
)]
#[ORM\Entity(repositoryClass: ErrorReportSubmissionRepository::class)]
class ErrorReportSubmission
{
use IdTrait,
UuidTrait,
TimestampableTrait;
#[ApiProperty(description: 'Full name')]
#[Groups(['read:' . self::class])]
#[Assert\NotBlank]
#[ORM\Column(type: Types::STRING, length: 511)]
private string $fullName;
#[ApiProperty(description: 'E-mail')]
#[Groups(['read:' . self::class])]
#[Assert\NotBlank]
#[Assert\Email]
#[ORM\Column(type: Types::STRING, length: 255)]
private string $email;
#[ApiProperty(description: 'Description')]
#[Groups(['read:' . self::class])]
#[Assert\NotBlank]
#[ORM\Column(type: Types::TEXT)]
private string $description;
public function __construct()
{
$this->setUuid();
$this->createdAt = new \DateTimeImmutable();
$this->updatedAt = new \DateTimeImmutable();
}
public function getFullName(): string
{
return $this->fullName;
}
public function setFullName(string $fullName): self
{
$this->fullName = $fullName;
return $this;
}
public function getEmail(): string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getDescription(): string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
}