src/Entity/AgendaProcedimiento.php line 15

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