vendor/croisiland/common-bundle/src/Entity/Itinerary/Destination.php line 28

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Croisiland\CommonBundle\Entity\Itinerary;
  4. use Crea\MediaBundle\Entity\MediaTagOwnerInterface;
  5. use Crea\ToolsBundle\Entity\LifecycleUserIdentifierTrait;
  6. use Croisiland\CommonBundle\Entity\Traits\IsActiveTrait;
  7. use Croisiland\CommonBundle\Entity\Traits\ListOrderTrait;
  8. use Croisiland\CommonBundle\Entity\Traits\ModuleOrderTrait;
  9. use Doctrine\Common\Util\ClassUtils;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Doctrine\ORM\Mapping\MappedSuperclass;
  12. use Gedmo\Mapping\Annotation as Gedmo;
  13. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  14. /**
  15. * @MappedSuperclass
  16. *
  17. * @UniqueEntity(
  18. * fields={"slug"},
  19. * errorPath="slug",
  20. * message="destination.slug.unique_constraint",
  21. * ignoreNull=true
  22. * )
  23. */
  24. class Destination implements \Stringable, MediaTagOwnerInterface
  25. {
  26. use ListOrderTrait;
  27. use ModuleOrderTrait;
  28. use IsActiveTrait;
  29. use LifecycleUserIdentifierTrait;
  30. /**
  31. * @ORM\Id
  32. *
  33. * @ORM\GeneratedValue
  34. *
  35. * @ORM\Column(type="integer")
  36. */
  37. private ?int $id = null;
  38. /**
  39. * @ORM\Column(type="string", length=255, nullable=false)
  40. */
  41. private ?string $name = null;
  42. /**
  43. * @Gedmo\Slug(fields={"name"}, updatable=false)
  44. *
  45. * @ORM\Column(type="string", length=255, nullable=true, unique=true)
  46. */
  47. private ?string $slug = null;
  48. /**
  49. * @ORM\Column(type="text", nullable=true)
  50. */
  51. private ?string $shortDescription = null;
  52. /**
  53. * @ORM\Column(type="text", nullable=true)
  54. */
  55. private ?string $description = null;
  56. /**
  57. * Destination fluviale
  58. * @ORM\Column(type="boolean", nullable=true)
  59. */
  60. private ?bool $riverside = null;
  61. public function __construct()
  62. {
  63. }
  64. public function __toString(): string
  65. {
  66. return $this->getName();
  67. }
  68. public function getId(): ?int
  69. {
  70. return $this->id;
  71. }
  72. public function getName(): ?string
  73. {
  74. return $this->name;
  75. }
  76. public function setName(string $name): self
  77. {
  78. $this->name = $name;
  79. return $this;
  80. }
  81. public function getSlug(): ?string
  82. {
  83. return $this->slug;
  84. }
  85. public function setSlug(?string $slug): self
  86. {
  87. $this->slug = $slug;
  88. return $this;
  89. }
  90. public function getShortDescription(): ?string
  91. {
  92. return $this->shortDescription;
  93. }
  94. public function setShortDescription(?string $shortDescription): self
  95. {
  96. $this->shortDescription = $shortDescription;
  97. return $this;
  98. }
  99. public function getDescription(): ?string
  100. {
  101. return $this->description;
  102. }
  103. public function setDescription(?string $description): self
  104. {
  105. $this->description = $description;
  106. return $this;
  107. }
  108. public function getRiverside(): ?bool
  109. {
  110. return $this->riverside;
  111. }
  112. public function setRiverside(?bool $riverside): Destination
  113. {
  114. $this->riverside = $riverside;
  115. return $this;
  116. }
  117. public function isRiverside(): ?bool
  118. {
  119. return $this->riverside;
  120. }
  121. /**
  122. * Method liée au Média Bundle
  123. */
  124. public function getMediaTagOwnerLabel(): ?string
  125. {
  126. return $this->getName();
  127. }
  128. /**
  129. * Method liée au Média Bundle
  130. * @return class-string
  131. */
  132. public function getFqcn(): string
  133. {
  134. return ClassUtils::getClass($this);
  135. }
  136. }