<?php
namespace App\Entity;
use App\Enum\TipoAccionEnum;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Sonata\AdminBundle\Admin\AdminInterface;
/**
* @ORM\Entity(repositoryClass="App\Repository\AccionCompetenciaRepository")
* @ORM\Table(name="accion_competencia", schema="perseo")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class AccionCompetencia extends AccionAbstract
{
/**
* @ORM\Column(type="float", nullable=true, precision=0)
*/
private $precio;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Canal", inversedBy="accionesCompetencia")
* @ORM\JoinColumn(name="canal_id", referencedColumnName="id")
*/
private $canal;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Competencia", inversedBy="accionesCompetencia")
* @ORM\JoinColumn(name="competencia_id", referencedColumnName="id")
*/
private $competencia;
public function __toString(): string
{
return $this->getCanal()?->getNombre() ?? '---';
}
public function getPrecio(): ?float
{
return $this->precio;
}
public function setPrecio(?float $precio): self
{
$this->precio = $precio;
return $this;
}
public function getCanal(): ?Canal
{
return $this->canal;
}
public function setCanal(?Canal $canal): self
{
$this->canal = $canal;
return $this;
}
public function getCompetencia(): ?Competencia
{
return $this->competencia;
}
public function setCompetencia(?Competencia $competencia): self
{
$this->competencia = $competencia;
return $this;
}
}