src/Entity/AccionCompetencia.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\TipoAccionEnum;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Sonata\AdminBundle\Admin\AdminInterface;
  7. /**
  8. * @ORM\Entity(repositoryClass="App\Repository\AccionCompetenciaRepository")
  9. * @ORM\Table(name="accion_competencia", schema="perseo")
  10. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  11. */
  12. class AccionCompetencia extends AccionAbstract
  13. {
  14. /**
  15. * @ORM\Column(type="float", nullable=true, precision=0)
  16. */
  17. private $precio;
  18. /**
  19. * @ORM\ManyToOne(targetEntity="App\Entity\Canal", inversedBy="accionesCompetencia")
  20. * @ORM\JoinColumn(name="canal_id", referencedColumnName="id")
  21. */
  22. private $canal;
  23. /**
  24. * @ORM\ManyToOne(targetEntity="App\Entity\Competencia", inversedBy="accionesCompetencia")
  25. * @ORM\JoinColumn(name="competencia_id", referencedColumnName="id")
  26. */
  27. private $competencia;
  28. public function __toString(): string
  29. {
  30. return $this->getCanal()?->getNombre() ?? '---';
  31. }
  32. public function getPrecio(): ?float
  33. {
  34. return $this->precio;
  35. }
  36. public function setPrecio(?float $precio): self
  37. {
  38. $this->precio = $precio;
  39. return $this;
  40. }
  41. public function getCanal(): ?Canal
  42. {
  43. return $this->canal;
  44. }
  45. public function setCanal(?Canal $canal): self
  46. {
  47. $this->canal = $canal;
  48. return $this;
  49. }
  50. public function getCompetencia(): ?Competencia
  51. {
  52. return $this->competencia;
  53. }
  54. public function setCompetencia(?Competencia $competencia): self
  55. {
  56. $this->competencia = $competencia;
  57. return $this;
  58. }
  59. }