<?phpnamespace App\Entity;use App\Repository\EscandalloProductRepository;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=EscandalloProductRepository::class) * @ORM\HasLifecycleCallbacks() */class EscandalloProduct{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="float") */ private $cantidad; /** * @ORM\Column(type="string", length=50, nullable=true) */ private $codigo; /** * @ORM\Column(type="float") */ private $coste; /** * @ORM\Column(type="datetime_immutable") */ private $createdAt; /** * @ORM\Column(type="datetime_immutable") */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) */ private $createdId; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) */ private $updatedId; /** * @ORM\ManyToOne(targetEntity=Escandallo::class, inversedBy="escandalloProducts") * @ORM\JoinColumn(nullable=false) */ private $escandallo; /** * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="escandalloProducts") */ private $product; /** * @ORM\ManyToOne(targetEntity=Escandallo::class, inversedBy="escandalloChildProducts") */ private $escandalloChild; public function getId(): ?int { return $this->id; } public function getCantidad(): ?float { return $this->cantidad; } public function setCantidad(float $cantidad): self { $this->cantidad = $cantidad; return $this; } public function getCodigo(): ?string { return $this->codigo; } public function setCodigo(?string $codigo): self { $this->codigo = $codigo; return $this; } public function getCoste(): ?float { return $this->coste; } public function setCoste(float $coste): self { $this->coste = $coste; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(\DateTimeImmutable $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } /** * @ORM\PrePersist */ public function setCreatedAtValue() { $this->createdAt = new \DateTimeImmutable(); } /** * @ORM\PrePersist * @ORM\PreUpdate */ public function setUpdatedAtValue() { $this->updatedAt = new \DateTimeImmutable(); } public function getCreatedId(): ?User { return $this->createdId; } public function setCreatedId(?User $createdId): self { $this->createdId = $createdId; return $this; } public function getUpdatedId(): ?User { return $this->updatedId; } public function setUpdatedId(?User $updatedId): self { $this->updatedId = $updatedId; return $this; } public function getEscandallo(): ?Escandallo { return $this->escandallo; } public function setEscandallo(?Escandallo $escandallo): self { $this->escandallo = $escandallo; return $this; } public function getProduct(): ?Product { return $this->product; } public function setProduct(?Product $product): self { $this->product = $product; return $this; } public function getEscandalloChild(): ?Escandallo { return $this->escandalloChild; } public function setEscandalloChild(?Escandallo $escandalloChild): self { $this->escandalloChild = $escandalloChild; return $this; }}