apiKeys = new ArrayCollection(); $this->resources = new ArrayCollection(); } public function getId(): ?int { return $this->id; } /** * @return Collection|APIKey[] */ public function getApiKeys(): Collection { return $this->apiKeys; } public function addApiKey(APIKey $apiKey): self { if (!$this->apiKeys->contains($apiKey)) { $this->apiKeys[] = $apiKey; $apiKey->setConsumer($this); } return $this; } public function removeApiKey(APIKey $apiKey): self { if ($this->apiKeys->removeElement($apiKey)) { // set the owning side to null (unless already changed) if ($apiKey->getConsumer() === $this) { $apiKey->setConsumer(null); } } return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } /** * @return Collection|Resource[] */ public function getResources(): Collection { return $this->resources; } public function addResource(Resource $resource): self { if (!$this->resources->contains($resource)) { $this->resources[] = $resource; $resource->setOwner($this); } return $this; } public function removeResource(Resource $resource): self { if ($this->resources->removeElement($resource)) { // set the owning side to null (unless already changed) if ($resource->getOwner() === $this) { $resource->setOwner(null); } } return $this; } }