Example #1
0
 /**
  * Factory method which allows for easy service creation
  *
  * @param  ClientInterface $client
  * @return self
  */
 public static function factory(ClientInterface $client)
 {
     $identity = new self();
     $identity->setClient($client);
     $identity->setEndpoint(clone $client->getAuthUrl());
     return $identity;
 }
 public static function factory(Openstack $client)
 {
     $identity = new self();
     $identity->setClient($client);
     $identity->setEndpoint($client->getAuthUrl());
     return $identity;
 }
Example #3
0
 function getInstance()
 {
     $_instance = '';
     if (!$_instance) {
         $_instance = new self();
         $_instance->setClient();
     }
     return $_instance;
 }
Example #4
0
 /**
  * Factory method which allows for easy service creation
  *
  * @param  ClientInterface $client
  * @return self
  */
 public static function factory(ClientInterface $client)
 {
     $identity = new self();
     if (($client instanceof Base || $client instanceof OpenStack) && $client->hasLogger()) {
         $identity->setLogger($client->getLogger());
     }
     $identity->setClient($client);
     $identity->setEndpoint(clone $client->getAuthUrl());
     return $identity;
 }
Example #5
0
 /**
  * Factory method which allows for easy service creation
  *
  * @param  ClientInterface $client
  * @return self
  */
 public static function factory(\Guzzle\Http\ClientInterface $client)
 {
     $tempAuth = new self();
     if (($client instanceof \OpenCloud\Common\Base || $client instanceof \OpenCloud\OpenStack) && $client->hasLogger()) {
         $tempAuth->setLogger($client->getLogger());
     }
     $tempAuth->setClient($client);
     $tempAuth->setEndpoint(clone $client->getAuthUrl());
     return $tempAuth;
 }
 /**
  * @param ApiClientInterface $client
  * @param UserInterface      $user
  *
  * @return TokenInterface
  */
 public static function create(ApiClientInterface $client, UserInterface $user = null)
 {
     $accessToken = new self();
     $accessToken->setUser($user);
     $accessToken->setClient($client);
     return $accessToken;
 }