'0', 'has_participle' => 'false', 'max_alternatives' => '0', 'speaker_number' => '2', 'has_seperate' => 'false', 'role_type' => '1', 'language' => 'cn', 'pd' => null ]; $this->lfasrType = $config['lfasr_type']; $this->hasParticiple = $config['has_participle']; $this->maxAlternatives = $config['max_alternatives']; $this->speakerNumber = $config['speaker_number']; $this->hasSeperate = $config['has_seperate']; $this->roleType = $config['role_type']; $this->language = $config['language']; $this->pd = $config['pd']; } /** * 去除null项后返回数组形式 * * @return array */ public function toArray() { return $this->removeNull([ 'lfasr_type' => $this->lfasrType, 'has_participle' => $this->hasParticiple, 'max_alternatives' => $this->maxAlternatives, 'speaker_number' => $this->speakerNumber, 'has_seperate' => $this->hasSeperate, 'role_type' => $this->roleType, 'language' => $this->language, 'pd' => $this->pd ]); } /** * 返回toArray的Json格式 * * @return string */ public function toJson() { return $this->jsonEncode($this->toArray()); } }