<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\ServerRepository")
*/
class Server
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
*/
private $host;
/**
* @ORM\Column(type="string", length=255)
*/
private $apikey;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Station", mappedBy="server", orphanRemoval=true)
*/
private $stations;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $rsync_target;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $rsync_host;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $rsync_port;
/**
* @ORM\Column(type="string", length=255)
*/
private $controlUser;
/**
* @ORM\Column(type="string", length=255)
*/
private $controlPass;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $timezoneDiff;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $listenPrefix;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $listenIp;
public function __toString(): string
{
return $this->name ?? '';
}
public function __construct()
{
$this->stations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getHost(): ?string
{
return $this->host;
}
public function setHost(string $host): self
{
$this->host = $host;
return $this;
}
public function getApikey(): ?string
{
return $this->apikey;
}
public function setApikey(string $apikey): self
{
$this->apikey = $apikey;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return Collection|Station[]
*/
public function getStations(): Collection
{
return $this->stations;
}
public function addStation(Station $station): self
{
if (!$this->stations->contains($station)) {
$this->stations[] = $station;
$station->setServer($this);
}
return $this;
}
public function removeStation(Station $station): self
{
if ($this->stations->contains($station)) {
$this->stations->removeElement($station);
// set the owning side to null (unless already changed)
if ($station->getServer() === $this) {
$station->setServer(null);
}
}
return $this;
}
public function getRsyncTarget(): ?string
{
return $this->rsync_target;
}
public function setRsyncTarget(?string $rsync_target): self
{
$this->rsync_target = $rsync_target;
return $this;
}
public function getRsyncHost(): ?string
{
return $this->rsync_host;
}
public function setRsyncHost(?string $rsync_host): self
{
$this->rsync_host = $rsync_host;
return $this;
}
public function getRsyncPort(): ?string
{
return $this->rsync_port;
}
public function setRsyncPort(?string $rsync_port): self
{
$this->rsync_port = $rsync_port;
return $this;
}
public function getControlUser(): ?string
{
return $this->controlUser;
}
public function setControlUser(string $controlUser): self
{
$this->controlUser = $controlUser;
return $this;
}
public function getControlPass(): ?string
{
return $this->controlPass;
}
public function setControlPass(string $controlPass): self
{
$this->controlPass = $controlPass;
return $this;
}
public function getTimezoneDiff(): ?string
{
return $this->timezoneDiff;
}
public function setTimezoneDiff(?string $timezoneDiff): self
{
$this->timezoneDiff = $timezoneDiff;
return $this;
}
public function getListenPrefix(): ?string
{
return $this->listenPrefix;
}
public function setListenPrefix(?string $listenPrefix): self
{
$this->listenPrefix = $listenPrefix;
return $this;
}
public function getListenIp(): ?string
{
return $this->listenIp;
}
public function setListenIp(?string $listenIp): self
{
$this->listenIp = $listenIp;
return $this;
}
}