src/JanusHercules/PotentialCustomerBusinessInfo/Domain/Entity/PotentialCustomerBusinessInfo.php line 14

Open in your IDE?
  1. <?php
  2. namespace JanusHercules\PotentialCustomerBusinessInfo\Domain\Entity;
  3. use App\Entity\EconomicSector;
  4. use App\Utility\DatabaseIdGenerator;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity]
  9. #[ORM\Table(name: 'potential_customer_business_infos')]
  10. #[ORM\UniqueConstraint(name: 'business_name_unique_idx', columns: ['business_name'])]
  11. class PotentialCustomerBusinessInfo
  12. {
  13. public function __construct(
  14. string $businessName,
  15. ?string $businessSize,
  16. string $city,
  17. ?string $contactEmail,
  18. ?string $contactName,
  19. EconomicSector $economicSector,
  20. string $streetAddress,
  21. ?string $turnover,
  22. string $zipcode,
  23. int $numberOfAvailableJobs
  24. ) {
  25. $this->businessName = $businessName;
  26. $this->businessSize = $businessSize;
  27. $this->city = $city;
  28. $this->contactEmail = $contactEmail;
  29. $this->contactName = $contactName;
  30. $this->economicSector = $economicSector;
  31. $this->streetAddress = $streetAddress;
  32. $this->turnover = $turnover;
  33. $this->zipcode = $zipcode;
  34. $this->numberOfAvailableJobs = $numberOfAvailableJobs;
  35. }
  36. #[ORM\GeneratedValue(strategy: 'CUSTOM')]
  37. #[ORM\CustomIdGenerator(class: DatabaseIdGenerator::class)]
  38. #[ORM\Column(
  39. name: 'id',
  40. type: Types::GUID)]
  41. #[ORM\Id]
  42. private ?string $id = null;
  43. public function getId(): ?string
  44. {
  45. return $this->id;
  46. }
  47. #[ORM\Column(
  48. name: 'business_name',
  49. type: Types::STRING,
  50. length: 255,
  51. nullable: false
  52. )]
  53. private string $businessName;
  54. public function getBusinessName(): string
  55. {
  56. return $this->businessName;
  57. }
  58. public function setBusinessName(string $businessName): void
  59. {
  60. $this->businessName = $businessName;
  61. }
  62. #[ORM\Column(
  63. name: 'business_size',
  64. type: Types::TEXT,
  65. length: 255,
  66. nullable: true
  67. )]
  68. private ?string $businessSize;
  69. public function getBusinessSize(): ?string
  70. {
  71. return $this->businessSize;
  72. }
  73. public function setBusinessSize(?string $businessSize): void
  74. {
  75. $this->businessSize = $businessSize;
  76. }
  77. #[ORM\Column(
  78. name: 'city',
  79. type: Types::TEXT,
  80. length: 255,
  81. nullable: false
  82. )]
  83. private string $city;
  84. public function getCity(): string
  85. {
  86. return $this->city;
  87. }
  88. public function setCity(string $city): void
  89. {
  90. $this->city = $city;
  91. }
  92. #[ORM\Column(
  93. name: 'contact_email',
  94. type: Types::TEXT,
  95. length: 255,
  96. nullable: true
  97. )]
  98. #[Assert\Email(mode: 'strict')]
  99. private ?string $contactEmail;
  100. public function getContactEmail(): ?string
  101. {
  102. return $this->contactEmail;
  103. }
  104. public function setContactEmail(?string $contactEmail): void
  105. {
  106. $this->contactEmail = $contactEmail;
  107. }
  108. #[ORM\Column(
  109. name: 'contact_name',
  110. type: Types::TEXT,
  111. length: 255,
  112. nullable: true
  113. )]
  114. private ?string $contactName;
  115. public function getContactName(): ?string
  116. {
  117. return $this->contactName;
  118. }
  119. public function setContactName(?string $contactName): void
  120. {
  121. $this->contactName = $contactName;
  122. }
  123. #[ORM\ManyToOne(
  124. targetEntity: EconomicSector::class,
  125. cascade: ['persist']
  126. )]
  127. #[ORM\JoinColumn(
  128. name: 'economic_sectors_id',
  129. referencedColumnName: 'id',
  130. nullable: true,
  131. onDelete: 'CASCADE'
  132. )]
  133. private EconomicSector $economicSector;
  134. public function getEconomicSector(): EconomicSector
  135. {
  136. return $this->economicSector;
  137. }
  138. public function setEconomicSector(EconomicSector $economicSector): void
  139. {
  140. $this->economicSector = $economicSector;
  141. }
  142. #[ORM\Column(
  143. name: 'street_address',
  144. type: Types::TEXT,
  145. length: 255,
  146. nullable: false
  147. )]
  148. private string $streetAddress;
  149. public function getStreetAddress(): string
  150. {
  151. return $this->streetAddress;
  152. }
  153. public function setStreetAddress(string $streetAddress): void
  154. {
  155. $this->streetAddress = $streetAddress;
  156. }
  157. #[ORM\Column(
  158. name: 'turnover',
  159. type: Types::TEXT,
  160. length: 255,
  161. nullable: true
  162. )]
  163. private ?string $turnover;
  164. public function getTurnover(): ?string
  165. {
  166. return $this->turnover;
  167. }
  168. public function setTurnover(?string $turnover): void
  169. {
  170. $this->turnover = $turnover;
  171. }
  172. #[ORM\Column(
  173. name: 'zipcode',
  174. type: Types::TEXT,
  175. length: 255,
  176. nullable: false
  177. )]
  178. private string $zipcode;
  179. public function getZipcode(): string
  180. {
  181. return $this->zipcode;
  182. }
  183. public function setZipcode(string $zipcode): void
  184. {
  185. $this->zipcode = $zipcode;
  186. }
  187. #[ORM\Column(
  188. name: 'number_of_available_jobs',
  189. type: Types::INTEGER,
  190. nullable: false
  191. )]
  192. private int $numberOfAvailableJobs;
  193. public function getNumberOfAvailableJobs(): int
  194. {
  195. return $this->numberOfAvailableJobs;
  196. }
  197. public function setNumberOfAvailableJobs(int $numberOfAvailableJobs): void
  198. {
  199. $this->numberOfAvailableJobs = $numberOfAvailableJobs;
  200. }
  201. }