src/Entity/Manufacturers.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ManufacturersRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: ManufacturersRepository::class)]
  8. class Manufacturers
  9. {
  10. #[ORM\Id]
  11. #[ORM\GeneratedValue]
  12. #[ORM\Column(type: 'integer')]
  13. private $id;
  14. #[ORM\Column(type: 'string', length: 255)]
  15. private $name;
  16. #[ORM\Column(type: 'datetime')]
  17. private $modified;
  18. #[ORM\Column(type: 'datetime')]
  19. private $created;
  20. #[ORM\OneToMany(targetEntity: ProductManufacturers::class, mappedBy: 'manufacturers')]
  21. private $productManufacturers;
  22. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  23. private $firstName;
  24. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  25. private $lastName;
  26. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  27. private $email;
  28. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  29. private $hashedEmail;
  30. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  31. private $telephone;
  32. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  33. private $isoCode;
  34. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  35. private $intlCode;
  36. #[ORM\OneToMany(targetEntity: ManufacturerUsers::class, mappedBy: 'manufacturer')]
  37. private $manufacturerUsers;
  38. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  39. private $logo;
  40. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  41. private $domainName;
  42. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  43. private $plainName;
  44. public function __construct()
  45. {
  46. $date = new \DateTime("now", new \DateTimeZone('Asia/Dubai'));
  47. $this->setModified($date);
  48. if ($this->getCreated() == null)
  49. {
  50. $this->setCreated($date);
  51. }
  52. $this->productManufacturers = new ArrayCollection();
  53. $this->manufacturerUsers = new ArrayCollection();
  54. }
  55. public function getId(): ?int
  56. {
  57. return $this->id;
  58. }
  59. public function getName(): ?string
  60. {
  61. return $this->name;
  62. }
  63. public function setName(string $name): self
  64. {
  65. $this->name = $name;
  66. return $this;
  67. }
  68. public function getModified(): ?\DateTimeInterface
  69. {
  70. return $this->modified;
  71. }
  72. public function setModified(\DateTimeInterface $modified): self
  73. {
  74. $this->modified = $modified;
  75. return $this;
  76. }
  77. public function getCreated(): ?\DateTimeInterface
  78. {
  79. return $this->created;
  80. }
  81. public function setCreated(\DateTimeInterface $created): self
  82. {
  83. $this->created = $created;
  84. return $this;
  85. }
  86. /**
  87. * @return Collection|Products[]
  88. */
  89. public function getProducts(): Collection
  90. {
  91. return $this->products;
  92. }
  93. public function addProducts(Products $products): self
  94. {
  95. if (!$this->products->contains($products)) {
  96. $this->products[] = $products;
  97. }
  98. return $this;
  99. }
  100. public function removeProducts(Products $products): self
  101. {
  102. $this->products->removeElement($products);
  103. return $this;
  104. }
  105. /**
  106. * @return string
  107. */
  108. public function __toString(){
  109. return $this->getName();
  110. }
  111. /**
  112. * @return Collection<int, ProductManufacturers>
  113. */
  114. public function getProductManufacturers(): Collection
  115. {
  116. return $this->productManufacturers;
  117. }
  118. public function addProductManufacturer(ProductManufacturers $productManufacturer): self
  119. {
  120. if (!$this->productManufacturers->contains($productManufacturer)) {
  121. $this->productManufacturers[] = $productManufacturer;
  122. $productManufacturer->setManufacturers($this);
  123. }
  124. return $this;
  125. }
  126. public function removeProductManufacturer(ProductManufacturers $productManufacturer): self
  127. {
  128. if ($this->productManufacturers->removeElement($productManufacturer)) {
  129. // set the owning side to null (unless already changed)
  130. if ($productManufacturer->getManufacturers() === $this) {
  131. $productManufacturer->setManufacturers(null);
  132. }
  133. }
  134. return $this;
  135. }
  136. public function getFirstName(): ?string
  137. {
  138. return $this->firstName;
  139. }
  140. public function setFirstName(string $firstName): self
  141. {
  142. $this->firstName = $firstName;
  143. return $this;
  144. }
  145. public function getLastName(): ?string
  146. {
  147. return $this->lastName;
  148. }
  149. public function setLastName(string $lastName): self
  150. {
  151. $this->lastName = $lastName;
  152. return $this;
  153. }
  154. public function getEmail(): ?string
  155. {
  156. return $this->email;
  157. }
  158. public function setEmail(string $email): self
  159. {
  160. $this->email = $email;
  161. return $this;
  162. }
  163. public function getHashedEmail(): ?string
  164. {
  165. return $this->hashedEmail;
  166. }
  167. public function setHashedEmail(string $hashedEmail): self
  168. {
  169. $this->hashedEmail = $hashedEmail;
  170. return $this;
  171. }
  172. public function getTelephone(): ?string
  173. {
  174. return $this->telephone;
  175. }
  176. public function setTelephone(string $telephone): self
  177. {
  178. $this->telephone = $telephone;
  179. return $this;
  180. }
  181. public function getIsoCode(): ?string
  182. {
  183. return $this->isoCode;
  184. }
  185. public function setIsoCode(string $isoCode): self
  186. {
  187. $this->isoCode = $isoCode;
  188. return $this;
  189. }
  190. public function getIntlCode(): ?string
  191. {
  192. return $this->intlCode;
  193. }
  194. public function setIntlCode(string $intlCode): self
  195. {
  196. $this->intlCode = $intlCode;
  197. return $this;
  198. }
  199. /**
  200. * @return Collection<int, ManufacturerUsers>
  201. */
  202. public function getManufacturerUsers(): Collection
  203. {
  204. return $this->manufacturerUsers;
  205. }
  206. public function addManufacturerUser(ManufacturerUsers $manufacturerUser): self
  207. {
  208. if (!$this->manufacturerUsers->contains($manufacturerUser)) {
  209. $this->manufacturerUsers[] = $manufacturerUser;
  210. $manufacturerUser->setManufacturer($this);
  211. }
  212. return $this;
  213. }
  214. public function removeManufacturerUser(ManufacturerUsers $manufacturerUser): self
  215. {
  216. if ($this->manufacturerUsers->removeElement($manufacturerUser)) {
  217. // set the owning side to null (unless already changed)
  218. if ($manufacturerUser->getManufacturer() === $this) {
  219. $manufacturerUser->setManufacturer(null);
  220. }
  221. }
  222. return $this;
  223. }
  224. public function getLogo(): ?string
  225. {
  226. return $this->logo;
  227. }
  228. public function setLogo(?string $logo): self
  229. {
  230. $this->logo = $logo;
  231. return $this;
  232. }
  233. public function getDomainName(): ?string
  234. {
  235. return $this->domainName;
  236. }
  237. public function setDomainName(?string $domainName): self
  238. {
  239. $this->domainName = $domainName;
  240. return $this;
  241. }
  242. public function getPlainName(): ?string
  243. {
  244. return $this->plainName;
  245. }
  246. public function setPlainName(?string $plainName): self
  247. {
  248. $this->plainName = $plainName;
  249. return $this;
  250. }
  251. }