vendor/croisiland/common-bundle/src/Entity/Partner/PartnerWebsite.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Croisiland\CommonBundle\Entity\Partner;
  4. use Crea\ToolsBundle\Entity\LifecycleUserIdentifierTrait;
  5. use Crea\ToolsBundle\Entity\StatefulTrait;
  6. use Croisiland\CommonBundle\Repository\Partner\PartnerWebsiteRepository;
  7. use Croisiland\CommonBundle\Annotation\Partner\PartnerWebsiteFormValidator;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Doctrine\ORM\Mapping\UniqueConstraint;
  10. /**
  11. * @ORM\Entity(repositoryClass=PartnerWebsiteRepository::class)
  12. * @PartnerWebsiteFormValidator(groups={"partner_website_form_validator"})
  13. */
  14. class PartnerWebsite
  15. {
  16. use LifecycleUserIdentifierTrait;
  17. use StatefulTrait;
  18. /**
  19. * @ORM\Id
  20. * @ORM\GeneratedValue
  21. * @ORM\Column(type="integer")
  22. */
  23. private ?int $id = null;
  24. /**
  25. * Relation OneToOne avec Partner
  26. * @ORM\OneToOne(targetEntity=Partner::class, inversedBy="website")
  27. * @ORM\JoinColumn(nullable=false)
  28. */
  29. private ?Partner $partner = null;
  30. // ========== Propriétés liées au site web ========== //
  31. /**
  32. * Sous-domaine du site partenaire
  33. * Correspond à "subDomainName" dans l'ancienne entité Partner
  34. * @ORM\Column(type="string", length=255, nullable=true, unique=true )
  35. *
  36. */
  37. private ?string $subDomain = null;
  38. /**
  39. * Indique si le logo doit être affiché
  40. * Correspond à "showLogo" dans l'ancienne entité Partner
  41. * @ORM\Column(type="boolean", options={"default": false})
  42. */
  43. private ?bool $displayLogo = false;
  44. /**
  45. * Texte descriptif des remises (bannière principale)
  46. * Correspond à "discountLabel" dans l'ancienne entité Partner
  47. * @ORM\Column(type="string", length=255, nullable=true)
  48. */
  49. private ?string $discountLabel = null;
  50. /**
  51. * Texte descriptif des remises (bannière secondaire)
  52. * Correspond à "secondDiscountLabel" dans l'ancienne entité Partner
  53. * @ORM\Column(type="string", length=255, nullable=true)
  54. */
  55. private ?string $secondDiscountLabel = null;
  56. // ========== Propriétés liées à l'authentification ========== //
  57. /**
  58. * Mot de passe chiffré
  59. * Correspond à "password" dans l'ancienne entité Partner
  60. * @ORM\Column(type="string", length=255, nullable=true)
  61. */
  62. private ?string $password = null;
  63. public function getId(): ?int
  64. {
  65. return $this->id;
  66. }
  67. public function getPartner(): ?Partner
  68. {
  69. return $this->partner;
  70. }
  71. public function setPartner(?Partner $partner): self
  72. {
  73. $this->partner = $partner;
  74. return $this;
  75. }
  76. public function isActive(): bool
  77. {
  78. return $this->active;
  79. }
  80. public function setActive(bool $active): self
  81. {
  82. $this->active = $active;
  83. return $this;
  84. }
  85. public function getSubDomain(): ?string
  86. {
  87. return $this->subDomain;
  88. }
  89. public function setSubDomain(?string $subDomain): self
  90. {
  91. $this->subDomain = $subDomain;
  92. return $this;
  93. }
  94. public function isDisplayLogo(): bool
  95. {
  96. return (bool) $this->displayLogo;
  97. }
  98. public function setDisplayLogo(?bool $displayLogo): self
  99. {
  100. $this->displayLogo = $displayLogo;
  101. return $this;
  102. }
  103. public function getDiscountLabel(): ?string
  104. {
  105. return $this->discountLabel;
  106. }
  107. public function setDiscountLabel(?string $discountLabel): self
  108. {
  109. $this->discountLabel = $discountLabel;
  110. return $this;
  111. }
  112. public function getSecondDiscountLabel(): ?string
  113. {
  114. return $this->secondDiscountLabel;
  115. }
  116. public function setSecondDiscountLabel(?string $secondDiscountLabel): self
  117. {
  118. $this->secondDiscountLabel = $secondDiscountLabel;
  119. return $this;
  120. }
  121. public function getPassword(): ?string
  122. {
  123. return $this->password;
  124. }
  125. public function setPassword(?string $password): self
  126. {
  127. $this->password = $password;
  128. return $this;
  129. }
  130. }