src/Entity/Server.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\ServerRepository")
  8. */
  9. class Server
  10. {
  11. /**
  12. * @ORM\Id()
  13. * @ORM\GeneratedValue()
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="string", length=255)
  19. */
  20. private $name;
  21. /**
  22. * @ORM\Column(type="string", length=255)
  23. */
  24. private $host;
  25. /**
  26. * @ORM\Column(type="string", length=255)
  27. */
  28. private $apikey;
  29. /**
  30. * @ORM\Column(type="text", nullable=true)
  31. */
  32. private $description;
  33. /**
  34. * @ORM\OneToMany(targetEntity="App\Entity\Station", mappedBy="server", orphanRemoval=true)
  35. */
  36. private $stations;
  37. /**
  38. * @ORM\Column(type="string", length=255, nullable=true)
  39. */
  40. private $rsync_target;
  41. /**
  42. * @ORM\Column(type="string", length=255, nullable=true)
  43. */
  44. private $rsync_host;
  45. /**
  46. * @ORM\Column(type="string", length=255, nullable=true)
  47. */
  48. private $rsync_port;
  49. /**
  50. * @ORM\Column(type="string", length=255)
  51. */
  52. private $controlUser;
  53. /**
  54. * @ORM\Column(type="string", length=255)
  55. */
  56. private $controlPass;
  57. /**
  58. * @ORM\Column(type="string", length=255, nullable=true)
  59. */
  60. private $timezoneDiff;
  61. /**
  62. * @ORM\Column(type="string", length=255, nullable=true)
  63. */
  64. private $listenPrefix;
  65. /**
  66. * @ORM\Column(type="string", length=255, nullable=true)
  67. */
  68. private $listenIp;
  69. public function __toString(): string
  70. {
  71. return $this->name ?? '';
  72. }
  73. public function __construct()
  74. {
  75. $this->stations = new ArrayCollection();
  76. }
  77. public function getId(): ?int
  78. {
  79. return $this->id;
  80. }
  81. public function getName(): ?string
  82. {
  83. return $this->name;
  84. }
  85. public function setName(string $name): self
  86. {
  87. $this->name = $name;
  88. return $this;
  89. }
  90. public function getHost(): ?string
  91. {
  92. return $this->host;
  93. }
  94. public function setHost(string $host): self
  95. {
  96. $this->host = $host;
  97. return $this;
  98. }
  99. public function getApikey(): ?string
  100. {
  101. return $this->apikey;
  102. }
  103. public function setApikey(string $apikey): self
  104. {
  105. $this->apikey = $apikey;
  106. return $this;
  107. }
  108. public function getDescription(): ?string
  109. {
  110. return $this->description;
  111. }
  112. public function setDescription(?string $description): self
  113. {
  114. $this->description = $description;
  115. return $this;
  116. }
  117. /**
  118. * @return Collection|Station[]
  119. */
  120. public function getStations(): Collection
  121. {
  122. return $this->stations;
  123. }
  124. public function addStation(Station $station): self
  125. {
  126. if (!$this->stations->contains($station)) {
  127. $this->stations[] = $station;
  128. $station->setServer($this);
  129. }
  130. return $this;
  131. }
  132. public function removeStation(Station $station): self
  133. {
  134. if ($this->stations->contains($station)) {
  135. $this->stations->removeElement($station);
  136. // set the owning side to null (unless already changed)
  137. if ($station->getServer() === $this) {
  138. $station->setServer(null);
  139. }
  140. }
  141. return $this;
  142. }
  143. public function getRsyncTarget(): ?string
  144. {
  145. return $this->rsync_target;
  146. }
  147. public function setRsyncTarget(?string $rsync_target): self
  148. {
  149. $this->rsync_target = $rsync_target;
  150. return $this;
  151. }
  152. public function getRsyncHost(): ?string
  153. {
  154. return $this->rsync_host;
  155. }
  156. public function setRsyncHost(?string $rsync_host): self
  157. {
  158. $this->rsync_host = $rsync_host;
  159. return $this;
  160. }
  161. public function getRsyncPort(): ?string
  162. {
  163. return $this->rsync_port;
  164. }
  165. public function setRsyncPort(?string $rsync_port): self
  166. {
  167. $this->rsync_port = $rsync_port;
  168. return $this;
  169. }
  170. public function getControlUser(): ?string
  171. {
  172. return $this->controlUser;
  173. }
  174. public function setControlUser(string $controlUser): self
  175. {
  176. $this->controlUser = $controlUser;
  177. return $this;
  178. }
  179. public function getControlPass(): ?string
  180. {
  181. return $this->controlPass;
  182. }
  183. public function setControlPass(string $controlPass): self
  184. {
  185. $this->controlPass = $controlPass;
  186. return $this;
  187. }
  188. public function getTimezoneDiff(): ?string
  189. {
  190. return $this->timezoneDiff;
  191. }
  192. public function setTimezoneDiff(?string $timezoneDiff): self
  193. {
  194. $this->timezoneDiff = $timezoneDiff;
  195. return $this;
  196. }
  197. public function getListenPrefix(): ?string
  198. {
  199. return $this->listenPrefix;
  200. }
  201. public function setListenPrefix(?string $listenPrefix): self
  202. {
  203. $this->listenPrefix = $listenPrefix;
  204. return $this;
  205. }
  206. public function getListenIp(): ?string
  207. {
  208. return $this->listenIp;
  209. }
  210. public function setListenIp(?string $listenIp): self
  211. {
  212. $this->listenIp = $listenIp;
  213. return $this;
  214. }
  215. }