示例#1
0
 /**
  * @param string $key
  *
  * @return Utils\ArrayHash|NULL
  */
 public function getDetails($key = NULL)
 {
     if ($this->details === NULL) {
         try {
             if ($this->profileId !== NULL) {
                 if (($result = $this->twitter->get('users/show.json', ['screen_name' => $this->profileId])) && $result instanceof Utils\ArrayHash) {
                     $this->details = $result;
                 }
             } else {
                 if ($user = $this->twitter->getUser()) {
                     if (($result = $this->twitter->get('users/show.json', ['user_id' => $user])) && $result instanceof Utils\ArrayHash) {
                         $this->details = $result;
                     }
                 } else {
                     $this->details = new Utils\ArrayHash();
                 }
             }
         } catch (\Exception $e) {
             // todo: log?
         }
     }
     if ($key !== NULL) {
         return isset($this->details[$key]) ? $this->details[$key] : NULL;
     }
     return $this->details;
 }
示例#2
0
 public function handleResponse()
 {
     $this->client->getUser();
     // check the received parameters and save user
     $this->onResponse($this);
     $this->presenter->redirect('this', ['oauth_token' => NULL, 'oauth_verifier' => NULL]);
 }