<?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\CanalRepository")
* @ORM\Table(name="canal", schema="perseo")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class Canal
{
/**
* @ORM\Id
* @ORM\Column(type="bigint", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", nullable=false)
*/
protected $nombre;
/**
* @ORM\Column(type="float", nullable=true, precision=2, options={"default": "0.00"})
*/
protected $comision;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $descripcion;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
protected $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
protected $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
protected $createdAt;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Valoracion", mappedBy="canal")
*/
protected $valoraciones;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Referencia", mappedBy="canal")
*/
protected $referencias;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\ValoracionesRelojesStock::class, mappedBy="plataformaPromocion")
*/
private $valoracionesRelojesStocks;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\AccionCompetencia::class, mappedBy="canal")
*/
protected $accionesCompetencia;
/**
* @ORM\OneToMany(targetEntity="App\Entity\AccionAnuncio", mappedBy="canal")
*/
protected $accionesAnuncio;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\ActividadAbstract::class, mappedBy="canal")
*/
private $actividades;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Operacion", mappedBy="canal")
*/
protected $operaciones;
public function __construct()
{
$this->referencias = new ArrayCollection();
$this->operaciones = new ArrayCollection();
$this->valoraciones = new ArrayCollection();
$this->accionesCompetencia = new ArrayCollection();
$this->accionesAnuncio = new ArrayCollection();
$this->actividades = new ArrayCollection();
$this->valoracionesRelojesStocks = 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): self
{
$this->nombre = $nombre;
return $this;
}
public function getComision(): ?float
{
return $this->comision;
}
public function setComision(float $comision): self
{
$this->comision = $comision;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection|Promocion[]
*/
public function getPromociones(): Collection
{
return $this->promociones;
}
public function addPromocione(Promocion $promocione): self
{
if (!$this->promociones->contains($promocione)) {
$this->promociones[] = $promocione;
$promocione->setCanal($this);
}
return $this;
}
public function removePromocione(Promocion $promocione): self
{
if ($this->promociones->removeElement($promocione)) {
// set the owning side to null (unless already changed)
if ($promocione->getCanal() === $this) {
$promocione->setCanal(null);
}
}
return $this;
}
/**
* @return Collection|Referencia[]
*/
public function getReferencias(): Collection
{
return $this->referencias;
}
public function addReferencia(Referencia $referencia): self
{
if (!$this->referencias->contains($referencia)) {
$this->referencias[] = $referencia;
$referencia->setCanal($this);
}
return $this;
}
public function removeReferencia(Referencia $referencia): self
{
if ($this->referencias->removeElement($referencia)) {
// set the owning side to null (unless already changed)
if ($referencia->getCanal() === $this) {
$referencia->setCanal(null);
}
}
return $this;
}
/**
* @return Collection|Operacion[]
*/
public function getOperaciones(): Collection
{
return $this->operaciones;
}
public function addOperacione(Operacion $operacione): self
{
if (!$this->operaciones->contains($operacione)) {
$this->operaciones[] = $operacione;
$operacione->setCanal($this);
}
return $this;
}
public function removeOperacione(Operacion $operacione): self
{
if ($this->operaciones->removeElement($operacione)) {
// set the owning side to null (unless already changed)
if ($operacione->getCanal() === $this) {
$operacione->setCanal(null);
}
}
return $this;
}
/**
* @return Collection|Valoracion[]
*/
public function getValoraciones(): Collection
{
return $this->valoraciones;
}
public function addValoracione(Valoracion $valoracione): self
{
if (!$this->valoraciones->contains($valoracione)) {
$this->valoraciones[] = $valoracione;
$valoracione->setCanal($this);
}
return $this;
}
public function removeValoracione(Valoracion $valoracione): self
{
if ($this->valoraciones->removeElement($valoracione)) {
// set the owning side to null (unless already changed)
if ($valoracione->getCanal() === $this) {
$valoracione->setCanal(null);
}
}
return $this;
}
public function getDescripcion(): ?string
{
return $this->descripcion;
}
public function setDescripcion(?string $descripcion): self
{
$this->descripcion = $descripcion;
return $this;
}
/**
* @return Collection<int, AccionCompetencia>
*/
public function getAccionesCompetencia(): Collection
{
return $this->accionesCompetencia;
}
public function addAccionesCompetencium(AccionCompetencia $accionesCompetencium): self
{
if (!$this->accionesCompetencia->contains($accionesCompetencium)) {
$this->accionesCompetencia->add($accionesCompetencium);
$accionesCompetencium->setCanal($this);
}
return $this;
}
public function removeAccionesCompetencium(AccionCompetencia $accionesCompetencium): self
{
if ($this->accionesCompetencia->removeElement($accionesCompetencium)) {
// set the owning side to null (unless already changed)
if ($accionesCompetencium->getCanal() === $this) {
$accionesCompetencium->setCanal(null);
}
}
return $this;
}
/**
* @return Collection<int, AccionAnuncio>
*/
public function getAccionesAnuncio(): Collection
{
return $this->accionesAnuncio;
}
public function addAccionesAnuncio(AccionAnuncio $accionesAnuncio): self
{
if (!$this->accionesAnuncio->contains($accionesAnuncio)) {
$this->accionesAnuncio->add($accionesAnuncio);
$accionesAnuncio->setCanal($this);
}
return $this;
}
public function removeAccionesAnuncio(AccionAnuncio $accionesAnuncio): self
{
if ($this->accionesAnuncio->removeElement($accionesAnuncio)) {
// set the owning side to null (unless already changed)
if ($accionesAnuncio->getCanal() === $this) {
$accionesAnuncio->setCanal(null);
}
}
return $this;
}
/**
* @return Collection<int, ActividadAbstract>
*/
public function getActividades(): Collection
{
return $this->actividades;
}
public function addActividade(ActividadAbstract $actividade): static
{
if (!$this->actividades->contains($actividade)) {
$this->actividades->add($actividade);
$actividade->setCanal($this);
}
return $this;
}
public function removeActividade(ActividadAbstract $actividade): static
{
if ($this->actividades->removeElement($actividade)) {
// set the owning side to null (unless already changed)
if ($actividade->getCanal() === $this) {
$actividade->setCanal(null);
}
}
return $this;
}
/**
* @return Collection<int, ValoracionesRelojesStock>
*/
public function getValoracionesRelojesStocks(): Collection
{
return $this->valoracionesRelojesStocks;
}
public function addValoracionesRelojesStock(ValoracionesRelojesStock $valoracionesRelojesStock): static
{
if (!$this->valoracionesRelojesStocks->contains($valoracionesRelojesStock)) {
$this->valoracionesRelojesStocks->add($valoracionesRelojesStock);
$valoracionesRelojesStock->setPlataformaPromocion($this);
}
return $this;
}
public function removeValoracionesRelojesStock(ValoracionesRelojesStock $valoracionesRelojesStock): static
{
if ($this->valoracionesRelojesStocks->removeElement($valoracionesRelojesStock)) {
// set the owning side to null (unless already changed)
if ($valoracionesRelojesStock->getPlataformaPromocion() === $this) {
$valoracionesRelojesStock->setPlataformaPromocion(null);
}
}
return $this;
}
}