src/Entity/GroupTicket/TransportCompany.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\GroupTicket;
  3. use App\Entity\Tu;
  4. use App\Entity\User;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity]
  10. class TransportCompany extends User
  11. {
  12. #[ORM\Column(length: 255)]
  13. #[Assert\NotBlank]
  14. private string $name = '';
  15. #[ORM\OneToMany(mappedBy: 'transportCompany', targetEntity: School::class, cascade: ["all"])]
  16. private Collection $schools;
  17. #[ORM\Column]
  18. private ?bool $allowedEditPriceList = null;
  19. #[ORM\ManyToMany(targetEntity: PublicConnection::class, inversedBy: 'transportCompanies')]
  20. private Collection $publicConnections;
  21. #[ORM\Column(length: 255)]
  22. #[Assert\NotBlank]
  23. private ?string $productNumber = null;
  24. #[ORM\Column(length: 255)]
  25. #[Assert\NotBlank]
  26. private ?string $tuNumber = null;
  27. #[ORM\Column(length: 255)]
  28. #[Assert\NotBlank]
  29. private ?string $taxNumber = null;
  30. #[ORM\Column(length: 255)]
  31. #[Assert\NotBlank]
  32. private ?string $productTitle = null;
  33. #[ORM\Column(length: 255, nullable: true)]
  34. private ?string $abbrevation = null;
  35. #[ORM\Column(length: 255, nullable: true)]
  36. private ?string $productLimitation = null;
  37. #[ORM\Column]
  38. #[Assert\NotBlank]
  39. private ?int $groupTicketClass = null;
  40. #[ORM\Column(length: 255)]
  41. #[Assert\NotBlank]
  42. private ?string $groupTicketSegment = null;
  43. #[ORM\Column(length: 255)]
  44. private ?string $groupTicketFqCode = null;
  45. #[ORM\Column(length: 255, nullable: true)]
  46. private ?string $footerTemplate = null;
  47. // Minimal group size (per transport company/verbund)
  48. #[ORM\Column(nullable: true)]
  49. private ?int $groupTicketMinSize = null;
  50. public function __construct()
  51. {
  52. parent::__construct();
  53. $this->schools = new ArrayCollection();
  54. $this->publicConnections = new ArrayCollection();
  55. }
  56. public function getGroupTicketMinSize(): ?int
  57. {
  58. return $this->groupTicketMinSize;
  59. }
  60. public function setGroupTicketMinSize(?int $groupTicketMinSize): static
  61. {
  62. $this->groupTicketMinSize = $groupTicketMinSize;
  63. return $this;
  64. }
  65. public function getName(): string
  66. {
  67. return $this->name;
  68. }
  69. public function setName(string $name): static
  70. {
  71. $this->name = $name;
  72. return $this;
  73. }
  74. /**
  75. * @return Collection<int, School>
  76. */
  77. public function getSchools(): Collection
  78. {
  79. return $this->schools;
  80. }
  81. public function addSchool(School $school): static
  82. {
  83. if (!$this->schools->contains($school)) {
  84. $this->schools->add($school);
  85. $school->setTransportCompany($this);
  86. }
  87. return $this;
  88. }
  89. public function removeSchool(School $school): static
  90. {
  91. if ($this->schools->removeElement($school)) {
  92. // set the owning side to null (unless already changed)
  93. if ($school->getTransportCompany() === $this) {
  94. $school->setTransportCompany(null);
  95. }
  96. }
  97. return $this;
  98. }
  99. public function isAllowedEditPriceList(): ?bool
  100. {
  101. return $this->allowedEditPriceList;
  102. }
  103. public function setAllowedEditPriceList(bool $allowedEditPriceList): static
  104. {
  105. $this->allowedEditPriceList = $allowedEditPriceList;
  106. return $this;
  107. }
  108. /**
  109. * @return Collection<int, PublicConnection>
  110. */
  111. public function getPublicConnections(): Collection
  112. {
  113. return $this->publicConnections;
  114. }
  115. public function addPublicConnection(PublicConnection $publicConnection): static
  116. {
  117. if (!$this->publicConnections->contains($publicConnection)) {
  118. $this->publicConnections->add($publicConnection);
  119. }
  120. return $this;
  121. }
  122. public function removePublicConnection(PublicConnection $publicConnection): static
  123. {
  124. $this->publicConnections->removeElement($publicConnection);
  125. return $this;
  126. }
  127. public function getProductNumber(): ?string
  128. {
  129. return $this->productNumber;
  130. }
  131. public function setProductNumber(string $productNumber): static
  132. {
  133. $this->productNumber = $productNumber;
  134. return $this;
  135. }
  136. public function getTuNumber(): ?string
  137. {
  138. return $this->tuNumber;
  139. }
  140. public function setTuNumber(string $tuNumber): static
  141. {
  142. $this->tuNumber = $tuNumber;
  143. return $this;
  144. }
  145. public function getTaxNumber(): ?string
  146. {
  147. return $this->taxNumber;
  148. }
  149. public function setTaxNumber(string $taxNumber): static
  150. {
  151. $this->taxNumber = $taxNumber;
  152. return $this;
  153. }
  154. public function getProductTitle(): ?string
  155. {
  156. return $this->productTitle;
  157. }
  158. public function setProductTitle(string $productTitle): static
  159. {
  160. $this->productTitle = $productTitle;
  161. return $this;
  162. }
  163. public function getAbbrevation(): ?string
  164. {
  165. return $this->abbrevation;
  166. }
  167. public function setAbbrevation(?string $abbrevation): static
  168. {
  169. $this->abbrevation = $abbrevation;
  170. return $this;
  171. }
  172. public function getProductLimitation(): ?string
  173. {
  174. return $this->productLimitation;
  175. }
  176. public function setProductLimitation(?string $productLimitation): static
  177. {
  178. $this->productLimitation = $productLimitation;
  179. return $this;
  180. }
  181. public function getGroupTicketClass(): ?int
  182. {
  183. return $this->groupTicketClass;
  184. }
  185. public function setGroupTicketClass(int $groupTicketClass): static
  186. {
  187. $this->groupTicketClass = $groupTicketClass;
  188. return $this;
  189. }
  190. public function getGroupTicketSegment(): ?string
  191. {
  192. return $this->groupTicketSegment;
  193. }
  194. public function setGroupTicketSegment(string $groupTicketSegment): static
  195. {
  196. $this->groupTicketSegment = $groupTicketSegment;
  197. return $this;
  198. }
  199. public function getGroupTicketFqCode(): ?string
  200. {
  201. return $this->groupTicketFqCode;
  202. }
  203. public function setGroupTicketFqCode(string $groupTicketFqCode): static
  204. {
  205. $this->groupTicketFqCode = $groupTicketFqCode;
  206. return $this;
  207. }
  208. public function getFooterTemplate(): ?string
  209. {
  210. return $this->footerTemplate;
  211. }
  212. public function setFooterTemplate(?string $footerTemplate): static
  213. {
  214. $this->footerTemplate = $footerTemplate;
  215. return $this;
  216. }
  217. }