src/Entity/ChannelUserData/Cursus/Adviser.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\ChannelUserData\Cursus;
  3. use Nellapp\Bundle\SDKBundle\TrackData\Attribute\TrackEntity;
  4. use Nellapp\Bundle\SDKBundle\TrackData\Attribute\TrackField;
  5. use App\Enum\ChannelUserData\Activity\CursusActivityTagEnum;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[
  9. ORM\Entity,
  10. ORM\Table(name: 'channel_user_data_cursus_founder_adviser'),
  11. TrackEntity(
  12. name: 'adviser.entity.track_data.entity.name',
  13. fieldGroups: [
  14. 'adviser' => [
  15. 'tags' => [ CursusActivityTagEnum::FOUNDING ]
  16. ]
  17. ],
  18. ),
  19. ]
  20. class Adviser
  21. {
  22. #[ORM\Id, ORM\GeneratedValue]
  23. #[ORM\Column(type: 'integer')]
  24. private ?int $id = null;
  25. #[ORM\OneToOne(inversedBy: 'adviser', targetEntity: Founder::class)]
  26. #[ORM\JoinColumn(name: 'founder_id', nullable: false, onDelete: 'CASCADE')]
  27. private ?Founder $founder = null;
  28. #[ORM\Column(type: 'string', nullable: true)]
  29. #[Assert\NotBlank(groups: ['Default'])]
  30. #[TrackField(name: 'adviser.entity.firstName.label', fieldKey: 'adviser')]
  31. private ?string $firstName = null;
  32. #[ORM\Column(type: 'string', nullable: true)]
  33. #[Assert\NotBlank(groups: ['Default'])]
  34. #[TrackField(name: 'adviser.entity.lastName.label', fieldKey: 'adviser')]
  35. private ?string $lastName = null;
  36. #[ORM\Column(type: 'string', nullable: true)]
  37. #[
  38. Assert\NotBlank(groups: ['Default']),
  39. Assert\Email(message: 'adviser.entity.email.Email.message', mode: 'strict', groups: ['Default'])
  40. ]
  41. #[TrackField(name: 'adviser.entity.email.label', fieldKey: 'adviser')]
  42. private ?string $email = null;
  43. #[ORM\Column(type: 'string', nullable: true)]
  44. #[
  45. Assert\Length(exactly: 10, exactMessage: 'adviser.entity.phone.Length.message', groups: ['Default'])
  46. ]
  47. #[TrackField(name: 'adviser.entity.phone.label', fieldKey: 'adviser')]
  48. private ?string $phone = null;
  49. public function __toString(): string
  50. {
  51. return $this->getFirstName() . ' ' . $this->getLastName();
  52. }
  53. public function getFirstName(): ?string
  54. {
  55. return $this->firstName;
  56. }
  57. public function setFirstName(?string $firstName): Adviser
  58. {
  59. $this->firstName = $firstName;
  60. return $this;
  61. }
  62. public function getLastName(): ?string
  63. {
  64. return $this->lastName;
  65. }
  66. public function setLastName(?string $lastName): Adviser
  67. {
  68. $this->lastName = $lastName;
  69. return $this;
  70. }
  71. public function getEmail(): ?string
  72. {
  73. return $this->email;
  74. }
  75. public function setEmail(?string $email): Adviser
  76. {
  77. $this->email = $email;
  78. return $this;
  79. }
  80. public function getPhone(): ?string
  81. {
  82. return $this->phone;
  83. }
  84. public function setPhone(?string $phone): Adviser
  85. {
  86. $this->phone = $phone;
  87. return $this;
  88. }
  89. public function getId(): ?int
  90. {
  91. return $this->id;
  92. }
  93. public function getFounder(): ?Founder
  94. {
  95. return $this->founder;
  96. }
  97. public function setFounder(?Founder $founder): Adviser
  98. {
  99. $this->founder = $founder;
  100. return $this;
  101. }
  102. }