src/Entity/Admin/ApiConnection.php line 14

  1. <?php
  2. namespace App\Entity\Admin;
  3. use App\Repository\Admin\ApiConnectionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Doctrine\ORM\Mapping\Table;
  9. #[ORM\Entity(repositoryClassApiConnectionRepository::class)]
  10. #[Table(name'ApiConnection')]
  11. class ApiConnection
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $name null;
  19.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  20.     private ?string $apiKey null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $clientKey null;
  23.     #[ORM\ManyToOne(inversedBy'apiConnections')]
  24.     private ?DatabaseUser $clientInternal null;
  25.     #[ORM\OneToMany(mappedBy'connection'targetEntityApiPreloadBooking::class)]
  26.     private Collection $apiPreloadBookings;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     private ?string $clientId null;
  29.     #[ORM\Column(nullabletrue)]
  30.     private ?float $brokerFee null;
  31.     #[ORM\OneToMany(mappedBy'ApiConnection'targetEntityApiBooking::class)]
  32.     private Collection $apiBookings;
  33.     public function __construct()
  34.     {
  35.         $this->apiPreloadBookings = new ArrayCollection();
  36.         $this->apiBookings = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getName(): ?string
  43.     {
  44.         return $this->name;
  45.     }
  46.     public function setName(string $name): self
  47.     {
  48.         $this->name $name;
  49.         return $this;
  50.     }
  51.     public function getApiKey(): ?string
  52.     {
  53.         return $this->apiKey;
  54.     }
  55.     public function setApiKey(string $apiKey): self
  56.     {
  57.         $this->apiKey $apiKey;
  58.         return $this;
  59.     }
  60.     public function getClientKey(): ?string
  61.     {
  62.         return $this->clientKey;
  63.     }
  64.     public function setClientKey(?string $clientKey): self
  65.     {
  66.         $this->clientKey $clientKey;
  67.         return $this;
  68.     }
  69.     public function getClientInternal(): ?DatabaseUser
  70.     {
  71.         return $this->clientInternal;
  72.     }
  73.     public function setClientInternal(?DatabaseUser $clientInternal): self
  74.     {
  75.         $this->clientInternal $clientInternal;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Collection<int, ApiPreloadBooking>
  80.      */
  81.     public function getApiPreloadBookings(): Collection
  82.     {
  83.         return $this->apiPreloadBookings;
  84.     }
  85.     public function addApiPreloadBooking(ApiPreloadBooking $apiPreloadBooking): self
  86.     {
  87.         if (!$this->apiPreloadBookings->contains($apiPreloadBooking)) {
  88.             $this->apiPreloadBookings->add($apiPreloadBooking);
  89.             $apiPreloadBooking->setConnection($this);
  90.         }
  91.         return $this;
  92.     }
  93.     public function removeApiPreloadBooking(ApiPreloadBooking $apiPreloadBooking): self
  94.     {
  95.         if ($this->apiPreloadBookings->removeElement($apiPreloadBooking)) {
  96.             // set the owning side to null (unless already changed)
  97.             if ($apiPreloadBooking->getConnection() === $this) {
  98.                 $apiPreloadBooking->setConnection(null);
  99.             }
  100.         }
  101.         return $this;
  102.     }
  103.     public function getClientId(): ?string
  104.     {
  105.         return $this->clientId;
  106.     }
  107.     public function setClientId(?string $clientId): static
  108.     {
  109.         $this->clientId $clientId;
  110.         return $this;
  111.     }
  112.     public function getBrokerFee(): ?float
  113.     {
  114.         return $this->brokerFee;
  115.     }
  116.     public function setBrokerFee(?float $brokerFee): static
  117.     {
  118.         $this->brokerFee $brokerFee;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, ApiBooking>
  123.      */
  124.     public function getApiBookings(): Collection
  125.     {
  126.         return $this->apiBookings;
  127.     }
  128.     public function addApiBooking(ApiBooking $apiBooking): static
  129.     {
  130.         if (!$this->apiBookings->contains($apiBooking)) {
  131.             $this->apiBookings->add($apiBooking);
  132.             $apiBooking->setApiConnection($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeApiBooking(ApiBooking $apiBooking): static
  137.     {
  138.         if ($this->apiBookings->removeElement($apiBooking)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($apiBooking->getApiConnection() === $this) {
  141.                 $apiBooking->setApiConnection(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146. }