Example #1
0
 /**
  * Add or Save Timesheet
  * @param Timesheet $timesheet
  * @return Timesheet
  */
 public function saveTimesheet(Timesheet $timesheet)
 {
     try {
         if ($timesheet->getTimesheetId() == '') {
             $idGenService = new IDGeneratorService();
             $idGenService->setEntity($timesheet);
             $timesheet->setTimesheetId($idGenService->getNextID());
         }
         $timesheet->save();
         return $timesheet;
     } catch (Exception $ex) {
         throw new DaoException($ex->getMessage());
     }
 }