Esempio n. 1
0
 /**
  * 取得指定游戏的配置信息
  * 
  * @param integer $gameType
  * @param string $section
  * @return array
  * @throws ZtChart_Model_Identification_Exception
  */
 public function getInfo($gameType, $section = null)
 {
     while ($this->_config->valid()) {
         foreach ($this->_config->current()->TypePara as $typePara) {
             if ($gameType == $typePara->Value) {
                 $info = $this->_config->current()->toArray();
                 if (!empty($section)) {
                     if (!array_key_exists($section, $info)) {
                         throw new ZtChart_Model_Identification_Exception("The section {$section} is not exist.");
                     }
                     $info = $info[$section];
                 }
                 return $info;
             }
         }
         $this->_config->next();
     }
     throw new ZtChart_Model_Identification_Exception("The gametype is not exist.");
 }