Exemple #1
0
 public static function parse_list($response)
 {
     $result = array();
     $res = Text::parse_json($response);
     if (!isset($res)) {
         throw new Exception($response);
     }
     foreach ($res as $re) {
         $obj = new self();
         $obj->user(WassrUser::parse($re["user"]));
         unset($re["user"]);
         $result[] = $obj->cp($re);
     }
     return $result;
 }
Exemple #2
0
 public static function parse_list($response)
 {
     $result = array();
     $res = Text::parse_json($response);
     if (!empty($res)) {
         foreach ($res as $re) {
             $obj = new self();
             $obj->user(WassrUser::parse($re["user"]));
             unset($re["user"]);
             $obj->channel(WassrChannel::parse($re["channel"]));
             unset($re["channel"]);
             $result[] = $obj->cp($re);
         }
     }
     return $result;
 }
Exemple #3
0
 /**
  * ニックネームを更新する
  *
  * @param string $nickname
  * @return WassrUser
  */
 public function update_nickname($nickname)
 {
     $this->vars("nick", $nickname);
     $this->do_post("user/edit.json");
     return WassrUser::parse($this->body());
 }