예제 #1
0
 public function getUsers()
 {
     $ids = $this->getListParameter(self::$USER_ID);
     if (empty($ids)) {
         if ($this->token->getViewerId() != null) {
             // Assume @me
             $ids = array("@me");
         } else {
             throw new IllegalArgumentException("No userId provided and viewer not available");
         }
     }
     $userIds = array();
     foreach ($ids as $id) {
         $userIds[] = UserId::fromJson($id);
     }
     return $userIds;
 }
 /**
  * Tests UserId->fromJson()
  */
 public function testFromJson()
 {
     $json = 'jsonid';
     $fromJson = $this->UserId->fromJson($json);
     $this->assertEquals('userId', $fromJson->getType());
 }
 public function getUser()
 {
     return isset($this->parameters[self::$USER_ID]) ? UserId::fromJson($this->parameters[self::$USER_ID]) : false;
 }