Пример #1
0
 /**
  * Saves SalaryGrade
  * @param String $id
  * @returns SalaryGrade. this is preserved as in the original but better to return boolean
  * @throws DaoException
  */
 public function saveSalaryGrade(SalaryGrade $salaryGrade)
 {
     try {
         if ($salaryGrade->getSalGrdCode() == '') {
             $idGenService = new IDGeneratorService();
             $idGenService->setEntity($salaryGrade);
             $salaryGrade->setSalGrdCode($idGenService->getNextID());
         }
         $salaryGrade->save();
         return $salaryGrade;
     } catch (Doctrine_Connection_Mysql_Exception $e) {
         throw new DataDuplicationException($e->getMessage());
     } catch (Exception $e) {
         throw new DaoException($e->getMessage());
     }
 }