src/Entity/ApiDetails.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ApiDetailsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassApiDetailsRepository::class)]
  8. class ApiDetails
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $clientId;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $clientSecret;
  18.     #[ORM\Column(type'datetime')]
  19.     private $modified;
  20.     #[ORM\Column(type'datetime')]
  21.     private $created;
  22.     #[ORM\OneToMany(targetEntityRefreshTokens::class, mappedBy'api')]
  23.     private $refreshTokens;
  24.     #[ORM\OneToOne(targetEntityDistributors::class, inversedBy'api'cascade: ['persist''remove'])]
  25.     private $distributor;
  26.     #[ORM\Column(type'string'length255)]
  27.     private $organizationId;
  28.     #[ORM\ManyToOne(targetEntityApi::class, inversedBy'apiDetails')]
  29.     private $api;
  30.     public function __construct()
  31.     {
  32.         $this->setModified(new \DateTime());
  33.         if ($this->getCreated() == null) {
  34.             $this->setCreated(new \DateTime());
  35.         }
  36.         $this->refreshTokens = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getClientId(): ?string
  43.     {
  44.         return $this->clientId;
  45.     }
  46.     public function setClientId(string $clientId): self
  47.     {
  48.         $this->clientId $clientId;
  49.         return $this;
  50.     }
  51.     public function getClientSecret(): ?string
  52.     {
  53.         return $this->clientSecret;
  54.     }
  55.     public function setClientSecret(string $clientSecret): self
  56.     {
  57.         $this->clientSecret $clientSecret;
  58.         return $this;
  59.     }
  60.     public function getModified(): ?\DateTimeInterface
  61.     {
  62.         return $this->modified;
  63.     }
  64.     public function setModified(\DateTimeInterface $modified): self
  65.     {
  66.         $this->modified $modified;
  67.         return $this;
  68.     }
  69.     public function getCreated(): ?\DateTimeInterface
  70.     {
  71.         return $this->created;
  72.     }
  73.     public function setCreated(\DateTimeInterface $created): self
  74.     {
  75.         $this->created $created;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Collection<int, RefreshTokens>
  80.      */
  81.     public function getRefreshTokens(): Collection
  82.     {
  83.         return $this->refreshTokens;
  84.     }
  85.     public function addRefreshToken(RefreshTokens $refreshToken): self
  86.     {
  87.         if (!$this->refreshTokens->contains($refreshToken)) {
  88.             $this->refreshTokens[] = $refreshToken;
  89.             $refreshToken->setApiDetails($this);
  90.         }
  91.         return $this;
  92.     }
  93.     public function removeRefreshToken(RefreshTokens $refreshToken): self
  94.     {
  95.         if ($this->refreshTokens->removeElement($refreshToken)) {
  96.             // set the owning side to null (unless already changed)
  97.             if ($refreshToken->getApiDetails() === $this) {
  98.                 $refreshToken->setApiDetails(null);
  99.             }
  100.         }
  101.         return $this;
  102.     }
  103.     public function getDistributor(): ?Distributors
  104.     {
  105.         return $this->distributor;
  106.     }
  107.     public function setDistributor(Distributors $distributor): self
  108.     {
  109.         $this->distributor $distributor;
  110.         return $this;
  111.     }
  112.     public function getOrganizationId(): ?string
  113.     {
  114.         return $this->organizationId;
  115.     }
  116.     public function setOrganizationId(string $organizationId): self
  117.     {
  118.         $this->organizationId $organizationId;
  119.         return $this;
  120.     }
  121.     public function getApi(): ?Api
  122.     {
  123.         return $this->api;
  124.     }
  125.     public function setApi(?Api $api): self
  126.     {
  127.         $this->api $api;
  128.         return $this;
  129.     }
  130. }