src/Entity/ImagenesEstudio.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ImagenesEstudioRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use DateTime;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ImagenesEstudioRepository::class)
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class ImagenesEstudio
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=Estudio::class, inversedBy="imagenesEstudios")
  22.      * @ORM\JoinColumn(nullable=false)
  23.      */
  24.     private $estudio;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $nombre;
  29.     /**
  30.      * @ORM\Column(type="boolean")
  31.      */
  32.     private $estado;
  33.     /**
  34.      * @ORM\Column(type="string", length=50)
  35.      */
  36.     private $ip_crea;
  37.     /**
  38.      * @ORM\Column(type="string", length=50)
  39.      */
  40.     private $ip_modifica;
  41.     /**
  42.      * @ORM\Column(type="integer")
  43.      */
  44.     private $user_crea;
  45.     /**
  46.      * @ORM\Column(type="integer")
  47.      */
  48.     private $user_modifica;
  49.     /**
  50.      * @ORM\Column(type="datetime")
  51.      */
  52.     private $created_at;
  53.     /**
  54.      * @ORM\Column(type="datetime")
  55.      */
  56.     private $updated_at;
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getEstudio(): ?Estudio
  62.     {
  63.         return $this->estudio;
  64.     }
  65.     public function setEstudio(?Estudio $estudio): self
  66.     {
  67.         $this->estudio $estudio;
  68.         return $this;
  69.     }
  70.     public function getNombre(): ?string
  71.     {
  72.         return $this->nombre;
  73.     }
  74.     public function setNombre(string $nombre): self
  75.     {
  76.         $this->nombre $nombre;
  77.         return $this;
  78.     }
  79.     public function getEstado(): ?bool
  80.     {
  81.         return $this->estado;
  82.     }
  83.     public function setEstado(bool $estado): self
  84.     {
  85.         $this->estado $estado;
  86.         return $this;
  87.     }
  88.     public function getIpCrea(): ?string
  89.     {
  90.         return $this->ip_crea;
  91.     }
  92.     public function setIpCrea(string $ip_crea): self
  93.     {
  94.         $this->ip_crea $ip_crea;
  95.         return $this;
  96.     }
  97.     public function getIpModifica(): ?string
  98.     {
  99.         return $this->ip_modifica;
  100.     }
  101.     public function setIpModifica(string $ip_modifica): self
  102.     {
  103.         $this->ip_modifica $ip_modifica;
  104.         return $this;
  105.     }
  106.     public function getUserCrea(): ?int
  107.     {
  108.         return $this->user_crea;
  109.     }
  110.     public function setUserCrea(int $user_crea): self
  111.     {
  112.         $this->user_crea $user_crea;
  113.         return $this;
  114.     }
  115.     public function getUserModifica(): ?int
  116.     {
  117.         return $this->user_modifica;
  118.     }
  119.     public function setUserModifica(int $user_modifica): self
  120.     {
  121.         $this->user_modifica $user_modifica;
  122.         return $this;
  123.     }
  124.     public function getCreatedAt(): ?\DateTimeInterface
  125.     {
  126.         return $this->created_at;
  127.     }
  128.     public function setCreatedAt(\DateTimeInterface $created_at): self
  129.     {
  130.         $this->created_at $created_at;
  131.         return $this;
  132.     }
  133.     public function getUpdatedAt(): ?\DateTimeInterface
  134.     {
  135.         return $this->updated_at;
  136.     }
  137.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  138.     {
  139.         $this->updated_at $updated_at;
  140.         return $this;
  141.     }
  142.     /**
  143.      * @ORM\PrePersist
  144.      * @ORM\PreUpdate
  145.      */
  146.     public function updatedTimestamps(): void
  147.     {
  148.         $dateTimeNow = new DateTime('now');
  149.         $this->setUpdatedAt($dateTimeNow);
  150.         if ($this->getCreatedAt() === null) {
  151.             $this->setCreatedAt($dateTimeNow);
  152.         }
  153.     }
  154. }