public function _save() { $oAuteurModel = new model_auteur(); $iId = _root::getParam('id', null); if ($iId == null) { $oAuteur = new row_auteur(); } else { $oAuteur = $oAuteurModel->findById(_root::getParam('id', null)); } foreach ($oAuteurModel->getListColumn() as $sColumn) { if (_root::getParam($sColumn, null) === null) { continue; } if (in_array($sColumn, $oAuteurModel->getIdTab())) { continue; } $oAuteur->{$sColumn} = _root::getParam($sColumn, null); } $oAuteur->save(); _root::redirect('auteur::edit', array('id' => $oAuteur->getId())); }