fkooman\OAuth\Client\Token::__construct PHP Метод

__construct() публичный Метод

public __construct ( array $data )
$data array
    public function __construct(array $data)
    {
        foreach (array('client_config_id', 'user_id', 'scope', 'issue_time') as $key) {
            if (!array_key_exists($key, $data)) {
                throw new TokenException(sprintf("missing field '%s'", $key));
            }
        }
        $this->setClientConfigId($data['client_config_id']);
        $this->setUserId($data['user_id']);
        $this->setScope($data['scope']);
        $this->setIssueTime($data['issue_time']);
    }

Usage Example

Пример #1
0
 public function __construct(array $data)
 {
     parent::__construct($data);
     foreach (array('refresh_token') as $key) {
         if (!array_key_exists($key, $data)) {
             throw new TokenException(sprintf("missing field '%s'", $key));
         }
     }
     $this->setRefreshToken($data['refresh_token']);
 }
All Usage Examples Of fkooman\OAuth\Client\Token::__construct