コード例 #1
0
ファイル: UnitTypeConfig.php プロジェクト: laiello/resmania
 /**
  * Register new unit type for all DEFAULT unit config value except some providerd
  *
  * @param  $unitTypeID
  * @param array $except
  * @return void
  */
 function register($unitTypeID, $except = array())
 {
     $model = new RM_UnitConfig();
     $default = $model->getDefault();
     foreach ($default as $row) {
         if (in_array($row->id, $except)) {
             continue;
         }
         if ($this->exist($unitTypeID, $row->id) == false) {
             $this->insert(array('unit_type_id' => $unitTypeID, 'unit_config_id' => $row->id));
         }
     }
 }