src/Entity/HdOrdenes.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HdOrdenesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use DateTime;
  6. /**
  7.  * @ORM\Entity(repositoryClass=HdOrdenesRepository::class)
  8.  * @ORM\HasLifecycleCallbacks
  9.  */
  10. class HdOrdenes
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=HdSolicitud::class, inversedBy="hdOrdenes")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $hd_solicitud;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Agenda::class, inversedBy="hdOrdenes")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $agenda;
  28.     /**
  29.      * @ORM\Column(type="string", length=50)
  30.      */
  31.     private $ip_crea;
  32.     /**
  33.      * @ORM\Column(type="string", length=50)
  34.      */
  35.     private $ip_modifica;
  36.     /**
  37.      * @ORM\Column(type="string", length=255)
  38.      */
  39.     private $user_crea;
  40.     /**
  41.      * @ORM\Column(type="integer")
  42.      */
  43.     private $user_modifica;
  44.     /**
  45.      * @ORM\Column(type="datetime")
  46.      */
  47.     private $created_at;
  48.     /**
  49.      * @ORM\Column(type="datetime")
  50.      */
  51.     private $updated_at;
  52.     public function getHdSolicitud(): ?HdSolicitud
  53.     {
  54.         return $this->hd_solicitud;
  55.     }
  56.     public function setHdSolicitud(?HdSolicitud $hd_solicitud): self
  57.     {
  58.         $this->hd_solicitud $hd_solicitud;
  59.         return $this;
  60.     }
  61.     public function getAgenda(): ?Agenda
  62.     {
  63.         return $this->agenda;
  64.     }
  65.     public function setAgenda(?Agenda $agenda): self
  66.     {
  67.         $this->agenda $agenda;
  68.         return $this;
  69.     }
  70.     public function getIpCrea(): ?string
  71.     {
  72.         return $this->ip_crea;
  73.     }
  74.     public function setIpCrea(string $ip_crea): self
  75.     {
  76.         $this->ip_crea $ip_crea;
  77.         return $this;
  78.     }
  79.     public function getIpModifica(): ?string
  80.     {
  81.         return $this->ip_modifica;
  82.     }
  83.     public function setIpModifica(string $ip_modifica): self
  84.     {
  85.         $this->ip_modifica $ip_modifica;
  86.         return $this;
  87.     }
  88.     public function getUserModifica(): ?int
  89.     {
  90.         return $this->user_modifica;
  91.     }
  92.     public function setUserModifica(int $user_modifica): self
  93.     {
  94.         $this->user_modifica $user_modifica;
  95.         return $this;
  96.     }
  97.     public function getCreatedAt(): ?\DateTimeInterface
  98.     {
  99.         return $this->created_at;
  100.     }
  101.     public function setCreatedAt(\DateTimeInterface $created_at): self
  102.     {
  103.         $this->created_at $created_at;
  104.         return $this;
  105.     }
  106.     public function getUpdatedAt(): ?\DateTimeInterface
  107.     {
  108.         return $this->updated_at;
  109.     }
  110.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  111.     {
  112.         $this->updated_at $updated_at;
  113.         return $this;
  114.     }
  115.      /**
  116.      * @ORM\PrePersist
  117.      * @ORM\PreUpdate
  118.      */
  119.     public function updatedTimestamps(): void
  120.     {
  121.         $dateTimeNow = new DateTime('now');
  122.         $this->setUpdatedAt($dateTimeNow);
  123.         if ($this->getCreatedAt() === null) {
  124.             $this->setCreatedAt($dateTimeNow);
  125.         }
  126.     }
  127. }