| 27 | | final class ScopeRepository extends AbstractRepository implements ScopeRepositoryInterface |
| 28 | | { |
| 29 | | public function getScopeEntityByIdentifier(string $identifier): ?ScopeEntityInterface |
| 30 | | { |
| 31 | | $query = sprintf( |
| 32 | | "SELECT scope_id FROM %s WHERE scope_id = '%s'", |
| 33 | | $this->table('faqoauth_scopes'), |
| 34 | | $this->db()->escape($identifier), |
| 35 | | ); |
| 36 | | |
| 37 | | $result = $this->db()->query($query); |
| 38 | | if ($result === false) { |
| 39 | | return null; |
| 40 | | } |
| 41 | | |
| 42 | | $row = $this->db()->fetchObject($result); |
| 43 | | if (!is_object($row)) { |
| 44 | | return null; |
| 45 | | } |
| 46 | | |
| 47 | | $scopeIdentifier = (string) $row->scope_id; |
| 48 | | if ($scopeIdentifier === '') { |
| 49 | | return null; |
| 50 | | } |
| 51 | | |
| 52 | | $scope = new ScopeEntity(); |
| 53 | | $scope->setIdentifier($scopeIdentifier); |
| 54 | | |
| 55 | | return $scope; |
| 56 | | } |
| 57 | | |
| 58 | | public function finalizeScopes( |
| 59 | | array $scopes, |
| 60 | | string $grantType, |
| 61 | | ClientEntityInterface $clientEntity, |
| 62 | | ?string $userIdentifier = null, |
| 63 | | ?string $authCodeId = null, |
| 64 | | ): array { |
| 65 | | return $scopes; |
| 66 | | } |
| 67 | | } |