src/Entity/SolicitudLog.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SolicitudLogRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=SolicitudLogRepository::class)
  7.  */
  8. class SolicitudLog
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=1000)
  18.      */
  19.     private $content;
  20.     /**
  21.      * @ORM\Column(type="datetime_immutable")
  22.      */
  23.     private $createdAt;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=User::class)
  26.      */
  27.     private $user;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=Solicitud::class, inversedBy="logs", cascade={"persist", "remove"})
  30.      */
  31.     private $solicitud;
  32.     public function __construct()
  33.     {
  34.         if(!$this->createdAt$this->setCreatedAt(new \DateTimeImmutable());
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getContent(): ?string
  41.     {
  42.         return $this->content;
  43.     }
  44.     public function setContent(string $content): self
  45.     {
  46.         $this->content $content;
  47.         return $this;
  48.     }
  49.     public function getCreatedAt(): ?\DateTimeImmutable
  50.     {
  51.         return $this->createdAt;
  52.     }
  53.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  54.     {
  55.         $this->createdAt $createdAt;
  56.         return $this;
  57.     }
  58.     public function getUser(): ?User
  59.     {
  60.         return $this->user;
  61.     }
  62.     public function setUser(?User $user): self
  63.     {
  64.         $this->user $user;
  65.         return $this;
  66.     }
  67.     public function getSolicitud(): ?Solicitud
  68.     {
  69.         return $this->solicitud;
  70.     }
  71.     public function setSolicitud(?Solicitud $solicitud): self
  72.     {
  73.         $this->solicitud $solicitud;
  74.         return $this;
  75.     }
  76.     public function setAutorizarRespuesta($value): self
  77.     {
  78.         $this->getSolicitud()->setAutorizaRespuesta($value);
  79.         return $this;
  80.     }
  81.     public function getAutorizarRespuesta()
  82.     {
  83.         return false;
  84.     }
  85.     public function __toString()
  86.     {
  87.         return $this->content;
  88.     }
  89. }