src/Entity/Notificacion.php line 33
<?phpnamespace App\Entity;use Ramsey\Uuid\Uuid;use App\Trait\UuidTrait;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\Put;use ApiPlatform\Metadata\Post;use ApiPlatform\Metadata\Patch;use ApiPlatform\Metadata\Delete;use Doctrine\ORM\Mapping as ORM;use App\Trait\TimestampableTrait;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\GetCollection;use App\Repository\NotificacionRepository;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: NotificacionRepository::class)]#[ApiResource(operations: [new Get(uriTemplate: 'notificaciones/{uuid}'),new Post(validationContext: ['groups' => ['Default', 'notificacion:create']], denormalizationContext: ['groups' => ['notificacion:create']], uriTemplate: 'notificaciones'),new GetCollection(uriTemplate: 'notificaciones'),new Put(denormalizationContext: ['groups' => ['notificacion:update']], uriTemplate: 'notificaciones/{uuid}'),new Patch(denormalizationContext: ['groups' => ['notificacion:update']], uriTemplate: 'notificaciones/{uuid}'),new Delete(uriTemplate: 'notificaciones/{uuid}'),],normalizationContext: ['groups' => ['notificacion:read', 'uuid']],)]class Notificacion{use TimestampableTrait;use UuidTrait;#[Assert\NotNull(groups: ['notificacion:create'])]#[Groups(['notificacion:read', 'notificacion:create'])]#[ORM\ManyToOne]#[ORM\JoinColumn(nullable: false)]private ?Empresa $empresa = null;#[Assert\NotNull(groups: ['notificacion:create'])]#[Groups(['notificacion:read', 'notificacion:create'])]#[ORM\Column(length: 255)]private ?string $titulo = null;#[Groups(['notificacion:read', 'notificacion:update'])]#[ORM\Column]private ?bool $isNew = null;#[Assert\NotNull(groups: ['notificacion:create'])]#[Groups(['notificacion:read', 'notificacion:create'])]#[ORM\Column(length: 255)]private ?string $modulo = null;#[Assert\NotNull(groups: ['notificacion:create'])]#[Groups(['notificacion:read', 'notificacion:create'])]#[ORM\Column(length: 255)]private ?string $modulo_ref = null;#[Groups(['notificacion:read', 'notificacion:create'])]#[ORM\Column(length: 255, nullable: true)]private ?string $hint = null;#[Assert\NotNull(groups: ['notificacion:create'])]#[Groups(['notificacion:read', 'notificacion:create'])]#[ORM\ManyToOne(inversedBy: 'notificaciones')]#[ORM\JoinColumn(nullable: false)]private ?User $user = null;public function __construct(){$this->uuid = Uuid::uuid4()->toString();}public function getEmpresa(): ?Empresa{return $this->empresa;}public function setEmpresa(?Empresa $empresa): self{$this->empresa = $empresa;return $this;}public function getTitulo(): ?string{return $this->titulo;}public function setTitulo(string $titulo): self{$this->titulo = $titulo;return $this;}public function isIsNew(): ?bool{return $this->isNew;}public function setIsNew(bool $isNew): self{$this->isNew = $isNew;return $this;}public function getModulo(): ?string{return $this->modulo;}public function setModulo(string $modulo): self{$this->modulo = $modulo;return $this;}public function getModuloRef(): ?string{return $this->modulo_ref;}public function setModuloRef(string $modulo_ref): self{$this->modulo_ref = $modulo_ref;return $this;}public function getHint(): ?string{return $this->hint;}public function setHint(?string $hint): self{$this->hint = $hint;return $this;}public function getCreatedAt(): ?\DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(\DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(?User $user): self{$this->user = $user;return $this;}}