src/Entity/Canal.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\CanalRepository")
  10.  * @ORM\Table(name="canal", schema="perseo")
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12.  */
  13. class Canal
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\Column(type="bigint", options={"unsigned":true})
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     protected $id;
  21.     /**
  22.      * @ORM\Column(type="string", nullable=false)
  23.      */
  24.     protected $nombre;
  25.     /**
  26.      * @ORM\Column(type="float", nullable=true, precision=2, options={"default": "0.00"})
  27.      */
  28.     protected $comision;
  29.     /**
  30.      * @ORM\Column(type="string", nullable=true)
  31.      */
  32.     protected $descripcion;
  33.     /**
  34.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  35.      */
  36.     protected $deletedAt;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  39.      * @Gedmo\Timestampable(on="update")
  40.      */
  41.     protected $updatedAt;
  42.     /**
  43.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  44.      * @Gedmo\Timestampable(on="create")
  45.      */
  46.     protected $createdAt;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity="App\Entity\Valoracion", mappedBy="canal")
  49.      */
  50.     protected $valoraciones;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity="App\Entity\Referencia", mappedBy="canal")
  53.      */
  54.     protected $referencias;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity=\App\Entity\ValoracionesRelojesStock::class, mappedBy="plataformaPromocion")
  57.      */
  58.     private $valoracionesRelojesStocks;
  59.     /**
  60.      * @ORM\OneToMany(targetEntity=\App\Entity\AccionCompetencia::class, mappedBy="canal")
  61.      */
  62.     protected $accionesCompetencia;
  63.     /**
  64.      * @ORM\OneToMany(targetEntity="App\Entity\AccionAnuncio", mappedBy="canal")
  65.      */
  66.     protected $accionesAnuncio;
  67.     /**
  68.      * @ORM\OneToMany(targetEntity=\App\Entity\ActividadAbstract::class, mappedBy="canal")
  69.      */
  70.     private $actividades;
  71.     /**
  72.      * @ORM\OneToMany(targetEntity="App\Entity\Operacion", mappedBy="canal")
  73.      */
  74.     protected $operaciones;
  75.     public function __construct()
  76.     {
  77.         $this->referencias = new ArrayCollection();
  78.         $this->operaciones = new ArrayCollection();
  79.         $this->valoraciones = new ArrayCollection();
  80.         $this->accionesCompetencia = new ArrayCollection();
  81.         $this->accionesAnuncio = new ArrayCollection();
  82.         $this->actividades = new ArrayCollection();
  83.         $this->valoracionesRelojesStocks = new ArrayCollection();
  84.     }
  85.     public function __toString(): string
  86.     {
  87.         return $this->getNombre()??'---';
  88.     }
  89.     public function getId(): ?string
  90.     {
  91.         return $this->id;
  92.     }
  93.     public function getNombre(): ?string
  94.     {
  95.         return $this->nombre;
  96.     }
  97.     public function setNombre(string $nombre): self
  98.     {
  99.         $this->nombre $nombre;
  100.         return $this;
  101.     }
  102.     public function getComision(): ?float
  103.     {
  104.         return $this->comision;
  105.     }
  106.     public function setComision(float $comision): self
  107.     {
  108.         $this->comision $comision;
  109.         return $this;
  110.     }
  111.     public function getDeletedAt(): ?\DateTimeInterface
  112.     {
  113.         return $this->deletedAt;
  114.     }
  115.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  116.     {
  117.         $this->deletedAt $deletedAt;
  118.         return $this;
  119.     }
  120.     public function getUpdatedAt(): ?\DateTimeInterface
  121.     {
  122.         return $this->updatedAt;
  123.     }
  124.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  125.     {
  126.         $this->updatedAt $updatedAt;
  127.         return $this;
  128.     }
  129.     public function getCreatedAt(): ?\DateTimeInterface
  130.     {
  131.         return $this->createdAt;
  132.     }
  133.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  134.     {
  135.         $this->createdAt $createdAt;
  136.         return $this;
  137.     }
  138.     /**
  139.      * @return Collection|Promocion[]
  140.      */
  141.     public function getPromociones(): Collection
  142.     {
  143.         return $this->promociones;
  144.     }
  145.     public function addPromocione(Promocion $promocione): self
  146.     {
  147.         if (!$this->promociones->contains($promocione)) {
  148.             $this->promociones[] = $promocione;
  149.             $promocione->setCanal($this);
  150.         }
  151.         return $this;
  152.     }
  153.     public function removePromocione(Promocion $promocione): self
  154.     {
  155.         if ($this->promociones->removeElement($promocione)) {
  156.             // set the owning side to null (unless already changed)
  157.             if ($promocione->getCanal() === $this) {
  158.                 $promocione->setCanal(null);
  159.             }
  160.         }
  161.         return $this;
  162.     }
  163.     /**
  164.      * @return Collection|Referencia[]
  165.      */
  166.     public function getReferencias(): Collection
  167.     {
  168.         return $this->referencias;
  169.     }
  170.     public function addReferencia(Referencia $referencia): self
  171.     {
  172.         if (!$this->referencias->contains($referencia)) {
  173.             $this->referencias[] = $referencia;
  174.             $referencia->setCanal($this);
  175.         }
  176.         return $this;
  177.     }
  178.     public function removeReferencia(Referencia $referencia): self
  179.     {
  180.         if ($this->referencias->removeElement($referencia)) {
  181.             // set the owning side to null (unless already changed)
  182.             if ($referencia->getCanal() === $this) {
  183.                 $referencia->setCanal(null);
  184.             }
  185.         }
  186.         return $this;
  187.     }
  188.     /**
  189.      * @return Collection|Operacion[]
  190.      */
  191.     public function getOperaciones(): Collection
  192.     {
  193.         return $this->operaciones;
  194.     }
  195.     public function addOperacione(Operacion $operacione): self
  196.     {
  197.         if (!$this->operaciones->contains($operacione)) {
  198.             $this->operaciones[] = $operacione;
  199.             $operacione->setCanal($this);
  200.         }
  201.         return $this;
  202.     }
  203.     public function removeOperacione(Operacion $operacione): self
  204.     {
  205.         if ($this->operaciones->removeElement($operacione)) {
  206.             // set the owning side to null (unless already changed)
  207.             if ($operacione->getCanal() === $this) {
  208.                 $operacione->setCanal(null);
  209.             }
  210.         }
  211.         return $this;
  212.     }
  213.     /**
  214.      * @return Collection|Valoracion[]
  215.      */
  216.     public function getValoraciones(): Collection
  217.     {
  218.         return $this->valoraciones;
  219.     }
  220.     public function addValoracione(Valoracion $valoracione): self
  221.     {
  222.         if (!$this->valoraciones->contains($valoracione)) {
  223.             $this->valoraciones[] = $valoracione;
  224.             $valoracione->setCanal($this);
  225.         }
  226.         return $this;
  227.     }
  228.     public function removeValoracione(Valoracion $valoracione): self
  229.     {
  230.         if ($this->valoraciones->removeElement($valoracione)) {
  231.             // set the owning side to null (unless already changed)
  232.             if ($valoracione->getCanal() === $this) {
  233.                 $valoracione->setCanal(null);
  234.             }
  235.         }
  236.         return $this;
  237.     }
  238.     public function getDescripcion(): ?string
  239.     {
  240.         return $this->descripcion;
  241.     }
  242.     public function setDescripcion(?string $descripcion): self
  243.     {
  244.         $this->descripcion $descripcion;
  245.         return $this;
  246.     }
  247.     /**
  248.      * @return Collection<int, AccionCompetencia>
  249.      */
  250.     public function getAccionesCompetencia(): Collection
  251.     {
  252.         return $this->accionesCompetencia;
  253.     }
  254.     public function addAccionesCompetencium(AccionCompetencia $accionesCompetencium): self
  255.     {
  256.         if (!$this->accionesCompetencia->contains($accionesCompetencium)) {
  257.             $this->accionesCompetencia->add($accionesCompetencium);
  258.             $accionesCompetencium->setCanal($this);
  259.         }
  260.         return $this;
  261.     }
  262.     public function removeAccionesCompetencium(AccionCompetencia $accionesCompetencium): self
  263.     {
  264.         if ($this->accionesCompetencia->removeElement($accionesCompetencium)) {
  265.             // set the owning side to null (unless already changed)
  266.             if ($accionesCompetencium->getCanal() === $this) {
  267.                 $accionesCompetencium->setCanal(null);
  268.             }
  269.         }
  270.         return $this;
  271.     }
  272.     /**
  273.      * @return Collection<int, AccionAnuncio>
  274.      */
  275.     public function getAccionesAnuncio(): Collection
  276.     {
  277.         return $this->accionesAnuncio;
  278.     }
  279.     public function addAccionesAnuncio(AccionAnuncio $accionesAnuncio): self
  280.     {
  281.         if (!$this->accionesAnuncio->contains($accionesAnuncio)) {
  282.             $this->accionesAnuncio->add($accionesAnuncio);
  283.             $accionesAnuncio->setCanal($this);
  284.         }
  285.         return $this;
  286.     }
  287.     public function removeAccionesAnuncio(AccionAnuncio $accionesAnuncio): self
  288.     {
  289.         if ($this->accionesAnuncio->removeElement($accionesAnuncio)) {
  290.             // set the owning side to null (unless already changed)
  291.             if ($accionesAnuncio->getCanal() === $this) {
  292.                 $accionesAnuncio->setCanal(null);
  293.             }
  294.         }
  295.         return $this;
  296.     }
  297.     /**
  298.      * @return Collection<int, ActividadAbstract>
  299.      */
  300.     public function getActividades(): Collection
  301.     {
  302.         return $this->actividades;
  303.     }
  304.     public function addActividade(ActividadAbstract $actividade): static
  305.     {
  306.         if (!$this->actividades->contains($actividade)) {
  307.             $this->actividades->add($actividade);
  308.             $actividade->setCanal($this);
  309.         }
  310.         return $this;
  311.     }
  312.     public function removeActividade(ActividadAbstract $actividade): static
  313.     {
  314.         if ($this->actividades->removeElement($actividade)) {
  315.             // set the owning side to null (unless already changed)
  316.             if ($actividade->getCanal() === $this) {
  317.                 $actividade->setCanal(null);
  318.             }
  319.         }
  320.         return $this;
  321.     }
  322.     /**
  323.      * @return Collection<int, ValoracionesRelojesStock>
  324.      */
  325.     public function getValoracionesRelojesStocks(): Collection
  326.     {
  327.         return $this->valoracionesRelojesStocks;
  328.     }
  329.     public function addValoracionesRelojesStock(ValoracionesRelojesStock $valoracionesRelojesStock): static
  330.     {
  331.         if (!$this->valoracionesRelojesStocks->contains($valoracionesRelojesStock)) {
  332.             $this->valoracionesRelojesStocks->add($valoracionesRelojesStock);
  333.             $valoracionesRelojesStock->setPlataformaPromocion($this);
  334.         }
  335.         return $this;
  336.     }
  337.     public function removeValoracionesRelojesStock(ValoracionesRelojesStock $valoracionesRelojesStock): static
  338.     {
  339.         if ($this->valoracionesRelojesStocks->removeElement($valoracionesRelojesStock)) {
  340.             // set the owning side to null (unless already changed)
  341.             if ($valoracionesRelojesStock->getPlataformaPromocion() === $this) {
  342.                 $valoracionesRelojesStock->setPlataformaPromocion(null);
  343.             }
  344.         }
  345.         return $this;
  346.     }
  347. }