hasMany('models\resource_server\ApiScope', 'api_id'); } /** * @return IApiEndpoint[] */ public function endpoints() { return $this->hasMany('models\resource_server\ApiEndpoint', 'api_id'); } /** * @return string */ public function getName() { return $this->name; } /** * @return string */ public function getDescription() { return $this->description; } /** * @return string */ public function getScope() { $scope = ''; foreach ($this->scopes()->get() as $s) { if (!$s->active) { continue; } $scope = $scope .$s->name.' '; } $scope = trim($scope); return $scope; } /** * @return bool */ public function isActive() { return $this->active; } public function setName($name) { $this->name = $name; } public function setDescription($description) { $this->description = $description; } public function setStatus($active) { $this->active = $active; } }