src/Entity/RecetaDetalle.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RecetaDetalleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use DateTime;
  6. /**
  7.  * @ORM\Entity(repositoryClass=RecetaDetalleRepository::class)
  8.  * @ORM\HasLifecycleCallbacks
  9.  */
  10. class RecetaDetalle
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Medicina::class, inversedBy="recetaDetalles")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $medicina;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $nombre;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $presentacion;
  31.     /**
  32.      * @ORM\Column(type="string", length=255)
  33.      */
  34.     private $indicacion;
  35.     /**
  36.      * @ORM\Column(type="string", length=50)
  37.      */
  38.     private $ip_crea;
  39.     /**
  40.      * @ORM\Column(type="string", length=50)
  41.      */
  42.     private $ip_modifica;
  43.     /**
  44.      * @ORM\Column(type="integer")
  45.      */
  46.     private $user_crea;
  47.     /**
  48.      * @ORM\Column(type="integer")
  49.      */
  50.     private $user_modifica;
  51.     /**
  52.      * @ORM\Column(type="datetime")
  53.      */
  54.     private $created_at;
  55.     /**
  56.      * @ORM\Column(type="datetime")
  57.      */
  58.     private $updated_at;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity=Receta::class, inversedBy="recetaDetalles")
  61.      */
  62.     private $receta;
  63.     /**
  64.      * @ORM\Column(type="decimal", precision=10, scale=2)
  65.      */
  66.     private $cantidad;
  67.     
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity=PlanoCabecera::class)
  70.      */
  71.     private $plano;
  72.     public function getId(): ?int
  73.     {
  74.         return $this->id;
  75.     }
  76.     public function getMedicina(): ?Medicina
  77.     {
  78.         return $this->medicina;
  79.     }
  80.     public function setMedicina(?Medicina $medicina): self
  81.     {
  82.         $this->medicina $medicina;
  83.         return $this;
  84.     }
  85.     public function getNombre(): ?string
  86.     {
  87.         return $this->nombre;
  88.     }
  89.     public function setNombre(string $nombre): self
  90.     {
  91.         $this->nombre $nombre;
  92.         return $this;
  93.     }
  94.     public function getPresentacion(): ?string
  95.     {
  96.         return $this->presentacion;
  97.     }
  98.     public function setPresentacion(?string $presentacion): self
  99.     {
  100.         $this->presentacion $presentacion;
  101.         return $this;
  102.     }
  103.     public function getIndicacion(): ?string
  104.     {
  105.         return $this->indicacion;
  106.     }
  107.     public function setIndicacion(string $indicacion): self
  108.     {
  109.         $this->indicacion $indicacion;
  110.         return $this;
  111.     }
  112.     public function getIpCrea(): ?string
  113.     {
  114.         return $this->ip_crea;
  115.     }
  116.     public function setIpCrea(string $ip_crea): self
  117.     {
  118.         $this->ip_crea $ip_crea;
  119.         return $this;
  120.     }
  121.     public function getIpModifica(): ?string
  122.     {
  123.         return $this->ip_modifica;
  124.     }
  125.     public function setIpModifica(string $ip_modifica): self
  126.     {
  127.         $this->ip_modifica $ip_modifica;
  128.         return $this;
  129.     }
  130.     public function getUserCrea(): ?int
  131.     {
  132.         return $this->user_crea;
  133.     }
  134.     public function setUserCrea(int $user_crea): self
  135.     {
  136.         $this->user_crea $user_crea;
  137.         return $this;
  138.     }
  139.     public function getUserModifica(): ?int
  140.     {
  141.         return $this->user_modifica;
  142.     }
  143.     public function setUserModifica(int $user_modifica): self
  144.     {
  145.         $this->user_modifica $user_modifica;
  146.         return $this;
  147.     }
  148.     public function getCreatedAt(): ?\DateTimeInterface
  149.     {
  150.         return $this->created_at;
  151.     }
  152.     public function setCreatedAt(\DateTimeInterface $created_at): self
  153.     {
  154.         $this->created_at $created_at;
  155.         return $this;
  156.     }
  157.     public function getUpdatedAt(): ?\DateTimeInterface
  158.     {
  159.         return $this->updated_at;
  160.     }
  161.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  162.     {
  163.         $this->updated_at $updated_at;
  164.         return $this;
  165.     }
  166.     public function getReceta(): ?Receta
  167.     {
  168.         return $this->receta;
  169.     }
  170.     public function setReceta(?Receta $receta): self
  171.     {
  172.         $this->receta $receta;
  173.         return $this;
  174.     }
  175.     /**
  176.      * @ORM\PrePersist
  177.      * @ORM\PreUpdate
  178.      */
  179.     public function updatedTimestamps(): void
  180.     {
  181.         $dateTimeNow = new DateTime('now');
  182.         $this->setUpdatedAt($dateTimeNow);
  183.         if ($this->getCreatedAt() === null) {
  184.             $this->setCreatedAt($dateTimeNow);
  185.         }
  186.     }
  187.     public function getCantidad(): ?string
  188.     {
  189.         return $this->cantidad;
  190.     }
  191.     public function setCantidad(string $cantidad): self
  192.     {
  193.         $this->cantidad $cantidad;
  194.         return $this;
  195.     }
  196.     
  197.     public function getPlano(): ?PlanoCabecera
  198.     {
  199.         return $this->plano;
  200.     }
  201.     public function setPlano(?PlanoCabecera $plano): self
  202.     {
  203.         $this->plano $plano;
  204.         return $this;
  205.     }
  206. }