'cn_vip', 'category' => 'read_sentence', 'aus' => 1, 'cmd' => 'ssb', 'text' => '', 'tte' => 'utf-8', 'ttp_skip' => true, 'extra_ability' => null, 'aue' => 'raw', 'rstcd' => 'utf8', 'group' => 'adult', 'check_type' => 'common', 'grade' => 'middle', 'rst' => 'entirety', 'ise_unite' => '0', 'plev' => '0' ]; $this->sub = 'ise'; $this->ent = $config['ent']; $this->category = $config['category']; $this->aus = $config['aus']; $this->cmd = $config['cmd']; $this->text = chr(239) . chr(187) . chr(191) . $config['text']; $this->tte = $config['tte']; $this->ttpSkip = $config['ttp_skip']; $this->extraAbility = $config['extra_ability']; $this->aue = $config['aue']; $this->rstcd = $config['rstcd']; $this->group = $config['group']; $this->checkType = $config['check_type']; $this->grade = $config['grade']; $this->rst = $config['rst']; $this->iseUnite = $config['ise_unite']; $this->plev = $config['plev']; } /** * 去除null项后返回数组形式 * * @return array */ public function toArray() { return $this->removeNull([ 'sub' => $this->sub, 'ent' => $this->ent, 'category' => $this->category, 'aus' => $this->aus, 'cmd' => $this->cmd, 'text' => $this->text, 'tte' => $this->tte, 'ttp_skip' => $this->ttpSkip, 'extra_ability' => $this->extraAbility, 'aue' => $this->aue, 'rstcd' => $this->rstcd, 'group' => $this->group, 'check_type' => $this->checkType, 'grade' => $this->grade, 'rst' => $this->rst, 'ise_unite' => $this->iseUnite, 'plev' => $this->plev ]); } /** * 返回toArray的Json格式 * * @return string */ public function toJson() { return $this->jsonEncode($this->toArray()); } public function setText($text) { $this->text = chr(239) . chr(187) . chr(191) . $text; } }