public function MessageAddFollows($id, CbgrnMessageFollowType $follow, $files = false) { // $id : IDType .. thread ID // $follow : CbgrnMessageFollowType class (only ONE) // $files : attached file's path (string, optional) CbgrnFileType class or this Array $this->CheckAndSetHeader(__FUNCTION__); $reg_args["add_follow"]["thread_id"] = $id; if ($files !== false) { if (is_array($files)) { $n = 0; foreach ($files as $file_path) { $fp = fopen($file_path, "r"); if ($fp == false) { throw new CbgrnSoapFault("007", __FUNCTION__); } $reg_args["add_follow"]["file"][$n]["content"] = fread($fp, filesize($file_path)); fclose($fp); $reg_args["add_follow"]["file"][$n]["id"] = $n + 1; $file = new CbgrnMessageFile($n + 1, basename($file_path)); $follow->file[] = $file; $n++; } } else { $fp = fopen($files, "r"); if ($fp == false) { throw new CbgrnSoapFault("007", __FUNCTION__); } $reg_args["add_follow"]["file"]["content"] = fread($fp, filesize($files)); fclose($fp); $reg_args["add_follow"]["file"]["id"] = "1"; $file = new CbgrnMessageFile(1, basename($files)); $follow->file = $file; } } $reg_args["add_follow"]["follow"] = $follow->getObjectVars(); $this->encodeString($reg_args, "content"); $results = parent::MessageAddFollows($reg_args); $this->methodClose(); return $this->decodeString($results->thread); }