scopes = new ArrayCollection(); $this->endpoints = new ArrayCollection(); } /** * @return ApiScope[] */ public function getScopes() { return $this->scopes; } /** * @param mixed $scopes */ public function setScopes($scopes) { $this->scopes = $scopes; } /** * @return ApiEndpoint[] */ public function getEndpoints() { return $this->endpoints; } /** * @param mixed $endpoints */ public function setEndpoints($endpoints) { $this->endpoints = $endpoints; } /** * @return string */ public function getName() { return $this->name; } /** * @param string $name */ public function setName($name) { $this->name = $name; } /** * @return string */ public function getDescription() { return $this->description; } /** * @param string $description */ public function setDescription($description) { $this->description = $description; } /** * @return boolean */ public function isActive() { return $this->active; } /** * @param boolean $active */ public function setActive($active) { $this->active = $active; } /** * @return string */ public function getScope() { $scope = ''; foreach ($this->getScopes() as $s) { if (!$s->isActive()) { continue; } $scope = $scope .$s->getName().' '; } $scope = trim($scope); return $scope; } /** * @return int[] */ public function getScopeIds():array { $ids = []; foreach ($this->getScopes() as $e) { $ids[] = intval($e->getId()); } return $ids; } /** * @return int[] */ public function getEndpointsIds():array { $ids = []; foreach ($this->getEndpoints() as $e) { $ids[] = intval($e->getId()); } return $ids; } }