src/Entity/AccionAnuncio.php line 14

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. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\AccionAnuncioRepository")
  8. * @ORM\Table(name="accion_anuncio", schema="perseo")
  9. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  10. */
  11. class AccionAnuncio extends AccionAbstract
  12. {
  13. /**
  14. * @ORM\Column(type="float", nullable=true, precision=2)
  15. */
  16. private $precio;
  17. /**
  18. * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  19. */
  20. private $despublicar;
  21. /**
  22. * @ORM\ManyToOne(targetEntity="App\Entity\Canal", inversedBy="accionesAnuncio")
  23. * @ORM\JoinColumn(name="canal_id", referencedColumnName="id")
  24. */
  25. private $canal;
  26. public function __toString(): string
  27. {
  28. return $this->getCanal()?->getNombre() ?? '---';
  29. }
  30. public function getPrecio(): ?float
  31. {
  32. return $this->precio;
  33. }
  34. public function setPrecio(?float $precio): self
  35. {
  36. $this->precio = $precio;
  37. return $this;
  38. }
  39. public function isDespublicar(): ?bool
  40. {
  41. return $this->despublicar;
  42. }
  43. public function setDespublicar(?bool $despublicar): self
  44. {
  45. $this->despublicar = $despublicar;
  46. return $this;
  47. }
  48. public function getCanal(): ?Canal
  49. {
  50. return $this->canal;
  51. }
  52. public function setCanal(?Canal $canal): self
  53. {
  54. $this->canal = $canal;
  55. return $this;
  56. }
  57. }