vendor/croisiland/common-bundle/src/Entity/Company/Advantage.php line 25

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Croisiland\CommonBundle\Entity\Company;
  4. use Crea\MediaBundle\Entity\MediaTagOwnerInterface;
  5. use Crea\ToolsBundle\Entity\CreaIconIdentifiedInterface;
  6. use Crea\ToolsBundle\Entity\CreaIconTrait;
  7. use Crea\ToolsBundle\Entity\LifecycleUserIdentifierTrait;
  8. use Croisiland\CommonBundle\Annotation\Company\AdvantageFormValidator;
  9. use Croisiland\CommonBundle\Entity\Traits\ColorTrait;
  10. use Croisiland\CommonBundle\Entity\Traits\IsActiveTrait;
  11. use Croisiland\CommonBundle\Entity\Traits\IsVisibleTrait;
  12. use Croisiland\CommonBundle\Entity\Traits\ListOrderTrait;
  13. use Croisiland\CommonBundle\Repository\Company\AdvantageRepository;
  14. use Doctrine\Common\Util\ClassUtils;
  15. use Doctrine\ORM\Mapping as ORM;
  16. /**
  17. * @ORM\Entity(repositoryClass=AdvantageRepository::class)
  18. *
  19. * @AdvantageFormValidator(groups={"advantage_form_validator"})
  20. */
  21. class Advantage implements MediaTagOwnerInterface, CreaIconIdentifiedInterface
  22. {
  23. use CreaIconTrait;
  24. use ListOrderTrait;
  25. use IsActiveTrait;
  26. use IsVisibleTrait;
  27. use LifecycleUserIdentifierTrait;
  28. /**
  29. * @ORM\Id
  30. *
  31. * @ORM\GeneratedValue
  32. *
  33. * @ORM\Column(type="integer")
  34. */
  35. private ?int $id;
  36. /**
  37. * @ORM\Column(type="string", length=255)
  38. */
  39. private ?string $name = null;
  40. /**
  41. * @ORM\Column(type="text", nullable=true)
  42. */
  43. private ?string $shortDescription = null;
  44. /**
  45. * @ORM\Column(type="text", nullable=true)
  46. */
  47. private ?string $description = null;
  48. /**
  49. * @ORM\Column(type="text", nullable=true)
  50. */
  51. private ?string $comment = null;
  52. /**
  53. * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="advantages")
  54. *
  55. * @ORM\JoinColumn(nullable=false)
  56. */
  57. private ?Company $company = null;
  58. public function getId(): ?int
  59. {
  60. return $this->id;
  61. }
  62. public function getName(): ?string
  63. {
  64. return $this->name;
  65. }
  66. public function setName(?string $name): self
  67. {
  68. $this->name = $name;
  69. return $this;
  70. }
  71. public function getShortDescription(): ?string
  72. {
  73. return $this->shortDescription;
  74. }
  75. public function setShortDescription(?string $shortDescription): Advantage
  76. {
  77. $this->shortDescription = $shortDescription;
  78. return $this;
  79. }
  80. public function getDescription(): ?string
  81. {
  82. return $this->description;
  83. }
  84. public function setDescription(?string $description): self
  85. {
  86. $this->description = $description;
  87. return $this;
  88. }
  89. public function getComment(): ?string
  90. {
  91. return $this->comment;
  92. }
  93. public function setComment(?string $comment): self
  94. {
  95. $this->comment = $comment;
  96. return $this;
  97. }
  98. public function getCompany(): ?Company
  99. {
  100. return $this->company;
  101. }
  102. public function setCompany(?Company $company): self
  103. {
  104. $this->company = $company;
  105. return $this;
  106. }
  107. /**
  108. * Method liée au Média Bundle
  109. */
  110. public function getMediaTagOwnerLabel(): ?string
  111. {
  112. return $this->getName();
  113. }
  114. /**
  115. * Method liée au Média Bundle
  116. * @return class-string
  117. */
  118. public function getFqcn(): string
  119. {
  120. return ClassUtils::getClass($this);
  121. }
  122. public function getIconLabel(): ?string
  123. {
  124. return $this->getName();
  125. }
  126. }