Esempio n. 1
0
 protected function createResultMap($vo, $row)
 {
     $reflection = new \ReflectionObject($vo);
     $newVo = $reflection->newInstance();
     foreach ($row as $colName => $colVal) {
         $arrTmp = explode('_', $colName);
         foreach ($arrTmp as $tK => $tV) {
             if ($tK == 0) {
                 $arrTmp[$tK] = strtoLower($tV);
             } else {
                 $arrTmp[$tK] = strtoupper(substr($tV, 0, 1)) . strtoLower(substr($tV, 1));
             }
         }
         $newVo->{'set' . implode('', $arrTmp)}($colVal);
         //$newVo->{'set'.str_replace('_','',$colName)}($colVal);
     }
     return $newVo;
 }