예제 #1
0
 public function deleteRoleQuestionnaire($roleQuestionnaireRow)
 {
     DbTable_RoleQuestionnaire::getInstance()->getAdapter()->beginTransaction();
     try {
         $roleQuestionnaireRow->delete();
         DbTable_RoleQuestionnaire::getInstance()->getAdapter()->commit();
         return array('status' => true);
     } catch (Vtx_UserException $e) {
         DbTable_RoleQuestionnaire::getInstance()->getAdapter()->rollBack();
         return array('status' => false, 'messageError' => $e->getMessage());
     } catch (Exception $e) {
         DbTable_RoleQuestionnaire::getInstance()->getAdapter()->rollBack();
         throw new Exception($e);
     }
 }
예제 #2
0
 public function verifyQuestionnaireRolePeriod($questionnaireId, $roleId)
 {
     $roleQuestionnaireRow = DbTable_RoleQuestionnaire::getInstance()->fetchRow(array('RoleId = ?' => $roleId, 'QuestionnaireId = ?' => $questionnaireId));
     if (!$roleQuestionnaireRow) {
         return true;
     } else {
         $dateNow = date('Y-m-d');
         $startDate = $roleQuestionnaireRow->getStartDate();
         $endDate = $roleQuestionnaireRow->getEndDate();
         if ($dateNow >= $startDate && $dateNow <= $endDate) {
             return true;
         }
         return false;
     }
     return false;
 }