src/Entity/EventTag.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity(repositoryClass="App\Repository\EventTagRepository")
  6. */
  7. class EventTag
  8. {
  9. /**
  10. * @ORM\Id()
  11. * @ORM\GeneratedValue()
  12. * @ORM\Column(type="integer")
  13. */
  14. private $id;
  15. /**
  16. * @ORM\ManyToOne(targetEntity="App\Entity\Event", inversedBy="eventTags")
  17. * @ORM\JoinColumn(nullable=false)
  18. */
  19. private $event;
  20. /**
  21. * @ORM\ManyToOne(targetEntity="App\Entity\Tag", inversedBy="eventTags")
  22. * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  23. */
  24. private $tag;
  25. /**
  26. * @ORM\Column(type="integer")
  27. */
  28. private $ord;
  29. /**
  30. * @ORM\Column(type="integer")
  31. */
  32. private $remoteId;
  33. /**
  34. * @ORM\Column(type="string", length=255, nullable=true)
  35. */
  36. private $remoteName;
  37. public function __construct()
  38. {
  39. $this->remoteId = -1;
  40. }
  41. public function __toString() : string
  42. {
  43. return $this->event->getName().' - '.($this->tag ?? 'deleted tag');
  44. }
  45. public function getId(): ?int
  46. {
  47. return $this->id;
  48. }
  49. public function getEvent(): ?Event
  50. {
  51. return $this->event;
  52. }
  53. public function setEvent(?Event $event): self
  54. {
  55. $this->event = $event;
  56. return $this;
  57. }
  58. public function getTag(): ?Tag
  59. {
  60. return $this->tag;
  61. }
  62. public function setTag(?Tag $tag): self
  63. {
  64. $this->tag = $tag;
  65. return $this;
  66. }
  67. public function getOrd(): ?int
  68. {
  69. return $this->ord;
  70. }
  71. public function setOrd(int $ord): self
  72. {
  73. $this->ord = $ord;
  74. return $this;
  75. }
  76. public function getRemoteId(): ?int
  77. {
  78. return $this->remoteId;
  79. }
  80. public function setRemoteId(int $remoteId): self
  81. {
  82. $this->remoteId = $remoteId;
  83. return $this;
  84. }
  85. public function getRemoteName(): ?string
  86. {
  87. return $this->remoteName;
  88. }
  89. public function setRemoteName(?string $remoteName): self
  90. {
  91. $this->remoteName = $remoteName;
  92. return $this;
  93. }
  94. }