<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\MaterialRepository")
* @ORM\Table(name="material")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class Material
{
/**
* @ORM\Id
* @ORM\Column(type="bigint", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $nombre;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $descripcion;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
private $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="cajaRelojMaterial")
*/
private $relojesCajaRelojMaterial;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="cajaRelojMaterialBisel")
*/
private $relojesCajaRelojMaterialBisel;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="pulseraMaterial")
*/
private $relojesPulseraMaterial;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="pulseraMaterialCierre")
*/
private $relojesPulseraMaterialCierre;
public function __construct()
{
$this->relojesCajaRelojMaterial = new ArrayCollection();
$this->relojesCajaRelojMaterialBisel = new ArrayCollection();
$this->relojesPulseraMaterial = new ArrayCollection();
$this->relojesPulseraMaterialCierre = new ArrayCollection();
}
public function __toString(): string
{
return $this->getNombre()??'---';
}
public function getId(): ?string
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(?string $nombre): static
{
$this->nombre = $nombre;
return $this;
}
public function getDescripcion(): ?string
{
return $this->descripcion;
}
public function setDescripcion(?string $descripcion): static
{
$this->descripcion = $descripcion;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): static
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection<int, Reloj>
*/
public function getRelojesCajaRelojMaterial(): Collection
{
return $this->relojesCajaRelojMaterial;
}
public function addRelojesCajaRelojMaterial(Reloj $relojesCajaRelojMaterial): static
{
if (!$this->relojesCajaRelojMaterial->contains($relojesCajaRelojMaterial)) {
$this->relojesCajaRelojMaterial->add($relojesCajaRelojMaterial);
$relojesCajaRelojMaterial->setCajaRelojMaterial($this);
}
return $this;
}
public function removeRelojesCajaRelojMaterial(Reloj $relojesCajaRelojMaterial): static
{
if ($this->relojesCajaRelojMaterial->removeElement($relojesCajaRelojMaterial)) {
// set the owning side to null (unless already changed)
if ($relojesCajaRelojMaterial->getCajaRelojMaterial() === $this) {
$relojesCajaRelojMaterial->setCajaRelojMaterial(null);
}
}
return $this;
}
/**
* @return Collection<int, Reloj>
*/
public function getRelojesCajaRelojMaterialBisel(): Collection
{
return $this->relojesCajaRelojMaterialBisel;
}
public function addRelojesCajaRelojMaterialBisel(Reloj $relojesCajaRelojMaterialBisel): static
{
if (!$this->relojesCajaRelojMaterialBisel->contains($relojesCajaRelojMaterialBisel)) {
$this->relojesCajaRelojMaterialBisel->add($relojesCajaRelojMaterialBisel);
$relojesCajaRelojMaterialBisel->setCajaRelojMaterialBisel($this);
}
return $this;
}
public function removeRelojesCajaRelojMaterialBisel(Reloj $relojesCajaRelojMaterialBisel): static
{
if ($this->relojesCajaRelojMaterialBisel->removeElement($relojesCajaRelojMaterialBisel)) {
// set the owning side to null (unless already changed)
if ($relojesCajaRelojMaterialBisel->getCajaRelojMaterialBisel() === $this) {
$relojesCajaRelojMaterialBisel->setCajaRelojMaterialBisel(null);
}
}
return $this;
}
/**
* @return Collection<int, Reloj>
*/
public function getRelojesPulseraMaterial(): Collection
{
return $this->relojesPulseraMaterial;
}
public function addRelojesPulseraMaterial(Reloj $relojesPulseraMaterial): static
{
if (!$this->relojesPulseraMaterial->contains($relojesPulseraMaterial)) {
$this->relojesPulseraMaterial->add($relojesPulseraMaterial);
$relojesPulseraMaterial->setPulseraMaterial($this);
}
return $this;
}
public function removeRelojesPulseraMaterial(Reloj $relojesPulseraMaterial): static
{
if ($this->relojesPulseraMaterial->removeElement($relojesPulseraMaterial)) {
// set the owning side to null (unless already changed)
if ($relojesPulseraMaterial->getPulseraMaterial() === $this) {
$relojesPulseraMaterial->setPulseraMaterial(null);
}
}
return $this;
}
/**
* @return Collection<int, Reloj>
*/
public function getRelojesPulseraMaterialCierre(): Collection
{
return $this->relojesPulseraMaterialCierre;
}
public function addRelojesPulseraMaterialCierre(Reloj $relojesPulseraMaterialCierre): static
{
if (!$this->relojesPulseraMaterialCierre->contains($relojesPulseraMaterialCierre)) {
$this->relojesPulseraMaterialCierre->add($relojesPulseraMaterialCierre);
$relojesPulseraMaterialCierre->setPulseraMaterialCierre($this);
}
return $this;
}
public function removeRelojesPulseraMaterialCierre(Reloj $relojesPulseraMaterialCierre): static
{
if ($this->relojesPulseraMaterialCierre->removeElement($relojesPulseraMaterialCierre)) {
// set the owning side to null (unless already changed)
if ($relojesPulseraMaterialCierre->getPulseraMaterialCierre() === $this) {
$relojesPulseraMaterialCierre->setPulseraMaterialCierre(null);
}
}
return $this;
}
}