src/Entity/Admin/ApiConnection.php line 14
<?php
namespace App\Entity\Admin;
use App\Repository\Admin\ApiConnectionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Table;
#[ORM\Entity(repositoryClass: ApiConnectionRepository::class)]
#[Table(name: 'ApiConnection')]
class ApiConnection
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $apiKey = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $clientKey = null;
#[ORM\ManyToOne(inversedBy: 'apiConnections')]
private ?DatabaseUser $clientInternal = null;
#[ORM\OneToMany(mappedBy: 'connection', targetEntity: ApiPreloadBooking::class)]
private Collection $apiPreloadBookings;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $clientId = null;
#[ORM\Column(nullable: true)]
private ?float $brokerFee = null;
#[ORM\OneToMany(mappedBy: 'ApiConnection', targetEntity: ApiBooking::class)]
private Collection $apiBookings;
public function __construct()
{
$this->apiPreloadBookings = new ArrayCollection();
$this->apiBookings = 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 getApiKey(): ?string
{
return $this->apiKey;
}
public function setApiKey(string $apiKey): self
{
$this->apiKey = $apiKey;
return $this;
}
public function getClientKey(): ?string
{
return $this->clientKey;
}
public function setClientKey(?string $clientKey): self
{
$this->clientKey = $clientKey;
return $this;
}
public function getClientInternal(): ?DatabaseUser
{
return $this->clientInternal;
}
public function setClientInternal(?DatabaseUser $clientInternal): self
{
$this->clientInternal = $clientInternal;
return $this;
}
/**
* @return Collection<int, ApiPreloadBooking>
*/
public function getApiPreloadBookings(): Collection
{
return $this->apiPreloadBookings;
}
public function addApiPreloadBooking(ApiPreloadBooking $apiPreloadBooking): self
{
if (!$this->apiPreloadBookings->contains($apiPreloadBooking)) {
$this->apiPreloadBookings->add($apiPreloadBooking);
$apiPreloadBooking->setConnection($this);
}
return $this;
}
public function removeApiPreloadBooking(ApiPreloadBooking $apiPreloadBooking): self
{
if ($this->apiPreloadBookings->removeElement($apiPreloadBooking)) {
// set the owning side to null (unless already changed)
if ($apiPreloadBooking->getConnection() === $this) {
$apiPreloadBooking->setConnection(null);
}
}
return $this;
}
public function getClientId(): ?string
{
return $this->clientId;
}
public function setClientId(?string $clientId): static
{
$this->clientId = $clientId;
return $this;
}
public function getBrokerFee(): ?float
{
return $this->brokerFee;
}
public function setBrokerFee(?float $brokerFee): static
{
$this->brokerFee = $brokerFee;
return $this;
}
/**
* @return Collection<int, ApiBooking>
*/
public function getApiBookings(): Collection
{
return $this->apiBookings;
}
public function addApiBooking(ApiBooking $apiBooking): static
{
if (!$this->apiBookings->contains($apiBooking)) {
$this->apiBookings->add($apiBooking);
$apiBooking->setApiConnection($this);
}
return $this;
}
public function removeApiBooking(ApiBooking $apiBooking): static
{
if ($this->apiBookings->removeElement($apiBooking)) {
// set the owning side to null (unless already changed)
if ($apiBooking->getApiConnection() === $this) {
$apiBooking->setApiConnection(null);
}
}
return $this;
}
}