Exemplo n.º 1
0
 /**
  * Return an array of registered OAuth providers for an account.
  *
  * @param string $guid
  *
  * @return array
  */
 public function getProviders($guid = null)
 {
     $providers = [];
     if ($guid === null) {
         $auth = $this->session->getAuthorisation();
         if ($auth === null) {
             return $providers;
         }
         $guid = $auth->getGuid();
     }
     $providerEntities = $this->records->getProvisionsByGuid($guid);
     if ($providerEntities === false) {
         return $providers;
     }
     /** @var Storage\Entity\Provider $providerEntity */
     foreach ($providerEntities as $providerEntity) {
         $providers[] = $providerEntity->getProvider();
     }
     return $providers;
 }