<?php
namespace App\Entity;
use App\Repository\RecetaDetalleRepository;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/**
* @ORM\Entity(repositoryClass=RecetaDetalleRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class RecetaDetalle
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Medicina::class, inversedBy="recetaDetalles")
* @ORM\JoinColumn(nullable=false)
*/
private $medicina;
/**
* @ORM\Column(type="string", length=255)
*/
private $nombre;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $presentacion;
/**
* @ORM\Column(type="string", length=255)
*/
private $indicacion;
/**
* @ORM\Column(type="string", length=50)
*/
private $ip_crea;
/**
* @ORM\Column(type="string", length=50)
*/
private $ip_modifica;
/**
* @ORM\Column(type="integer")
*/
private $user_crea;
/**
* @ORM\Column(type="integer")
*/
private $user_modifica;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\ManyToOne(targetEntity=Receta::class, inversedBy="recetaDetalles")
*/
private $receta;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
*/
private $cantidad;
/**
* @ORM\ManyToOne(targetEntity=PlanoCabecera::class)
*/
private $plano;
public function getId(): ?int
{
return $this->id;
}
public function getMedicina(): ?Medicina
{
return $this->medicina;
}
public function setMedicina(?Medicina $medicina): self
{
$this->medicina = $medicina;
return $this;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getPresentacion(): ?string
{
return $this->presentacion;
}
public function setPresentacion(?string $presentacion): self
{
$this->presentacion = $presentacion;
return $this;
}
public function getIndicacion(): ?string
{
return $this->indicacion;
}
public function setIndicacion(string $indicacion): self
{
$this->indicacion = $indicacion;
return $this;
}
public function getIpCrea(): ?string
{
return $this->ip_crea;
}
public function setIpCrea(string $ip_crea): self
{
$this->ip_crea = $ip_crea;
return $this;
}
public function getIpModifica(): ?string
{
return $this->ip_modifica;
}
public function setIpModifica(string $ip_modifica): self
{
$this->ip_modifica = $ip_modifica;
return $this;
}
public function getUserCrea(): ?int
{
return $this->user_crea;
}
public function setUserCrea(int $user_crea): self
{
$this->user_crea = $user_crea;
return $this;
}
public function getUserModifica(): ?int
{
return $this->user_modifica;
}
public function setUserModifica(int $user_modifica): self
{
$this->user_modifica = $user_modifica;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getReceta(): ?Receta
{
return $this->receta;
}
public function setReceta(?Receta $receta): self
{
$this->receta = $receta;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps(): void
{
$dateTimeNow = new DateTime('now');
$this->setUpdatedAt($dateTimeNow);
if ($this->getCreatedAt() === null) {
$this->setCreatedAt($dateTimeNow);
}
}
public function getCantidad(): ?string
{
return $this->cantidad;
}
public function setCantidad(string $cantidad): self
{
$this->cantidad = $cantidad;
return $this;
}
public function getPlano(): ?PlanoCabecera
{
return $this->plano;
}
public function setPlano(?PlanoCabecera $plano): self
{
$this->plano = $plano;
return $this;
}
}