$t->is($obj->getAppUid(), $appUid, "update() APP_UID = " . $appUid); //#27 $t->is($obj->getAppTitle(), $newTitle, "update() getAppTitle"); //#28 $t->is($Fields['APP_TITLE'], $newTitle, "update() APP_TITLE= " . $newTitle); //#29 $t->is($Fields['APP_INIT_DATE'], date('Y-m-d H:i:s'), "update() APP_INIT_DATE= " . date('Y-m-d H:i:s')); } catch (Exception $e) { //#14 // $t->isa_ok( $e, 'PropelException', 'update() return error ' . $e->getMessage() ); $t->isa_ok($e, 'Exception', 'update() return error ' . $e->getMessage()); } //remove with empty try { $obj = new Application(); $res = $obj->remove(NULL); } catch (Exception $e) { //#30 $t->isa_ok($e, 'Exception', 'remove() returns error when APP_UID is not defined'); //#31 $t->is($e->getMessage(), "The row '' in table Application doesn't exist!", "remove() This row doesn't exist!"); } /* //remove with $fields $Fields['APP_UID'] = $appUid; try { $obj = new Application (); //$res = $obj->remove( $Fields ); $t->todo ( "check why this sentence is not working : $res = $obj->remove( $Fields ); " ); //#32
public function removeCase($sAppUid) { try { $this->getExecuteTriggerProcess($sAppUid, 'DELETED'); $oAppDelegation = new AppDelegation(); $oAppDocument = new AppDocument(); //Delete the delegations of a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppDelegationPeer::APP_UID, $sAppUid); $oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2); $oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset2->next(); while ($aRow2 = $oDataset2->getRow()) { $oAppDelegation->remove($sAppUid, $aRow2['DEL_INDEX']); $oDataset2->next(); } //Delete the documents assigned to a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppDocumentPeer::APP_UID, $sAppUid); $oDataset2 = AppDocumentPeer::doSelectRS($oCriteria2); $oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset2->next(); while ($aRow2 = $oDataset2->getRow()) { $oAppDocument->remove($aRow2['APP_DOC_UID'], $aRow2['DOC_VERSION']); $oDataset2->next(); } //Delete the actions from a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppDelayPeer::APP_UID, $sAppUid); AppDelayPeer::doDelete($oCriteria2); //Delete the messages from a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppMessagePeer::APP_UID, $sAppUid); AppMessagePeer::doDelete($oCriteria2); //Delete the threads from a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppThreadPeer::APP_UID, $sAppUid); AppThreadPeer::doDelete($oCriteria2); //Delete the events from a application $criteria = new Criteria("workflow"); $criteria->add(AppEventPeer::APP_UID, $sAppUid); AppEventPeer::doDelete($criteria); //Delete the histories from a application $criteria = new Criteria("workflow"); $criteria->add(AppHistoryPeer::APP_UID, $sAppUid); AppHistoryPeer::doDelete($criteria); //Delete the notes from a application $criteria = new Criteria("workflow"); $criteria->add(AppNotesPeer::APP_UID, $sAppUid); AppNotesPeer::doDelete($criteria); //Delete the owners from a application $criteria = new Criteria("workflow"); $criteria->add(AppOwnerPeer::APP_UID, $sAppUid); AppOwnerPeer::doDelete($criteria); //Delete the SolrQueue from a application $criteria = new Criteria("workflow"); $criteria->add(AppSolrQueuePeer::APP_UID, $sAppUid); AppSolrQueuePeer::doDelete($criteria); //Before delete verify if is a child case $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(SubApplicationPeer::APP_UID, $sAppUid); $oCriteria2->add(SubApplicationPeer::SA_STATUS, 'ACTIVE'); if (SubApplicationPeer::doCount($oCriteria2) > 0) { G::LoadClass('derivation'); $oDerivation = new Derivation(); $oDerivation->verifyIsCaseChild($sAppUid); } //Delete the registries in the table SUB_APPLICATION $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(SubApplicationPeer::APP_UID, $sAppUid); SubApplicationPeer::doDelete($oCriteria2); $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(SubApplicationPeer::APP_PARENT, $sAppUid); SubApplicationPeer::doDelete($oCriteria2); //Delete records of the table APP_ASSIGN_SELF_SERVICE_VALUE $appAssignSelfServiceValue = new AppAssignSelfServiceValue(); $appAssignSelfServiceValue->remove($sAppUid); //Delete records of the Report Table $this->reportTableDeleteRecord($sAppUid); //Delete record of the APPLICATION table (trigger: delete records of the APP_CACHE_VIEW table) $application = new Application(); $result = $application->remove($sAppUid); //delete application from index if ($this->appSolr != null) { $this->appSolr->deleteApplicationSearchIndex($sAppUid); } /*----------------------------------********---------------------------------*/ return $result; } catch (exception $e) { throw ($e); } }
public function removeCase($sAppUid) { try { $oApplication = new Application(); $oAppDelegation = new AppDelegation(); $oAppDocument = new AppDocument(); //Delete the delegations of a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppDelegationPeer::APP_UID, $sAppUid); $oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2); $oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset2->next(); while ($aRow2 = $oDataset2->getRow()) { $oAppDelegation->remove($sAppUid, $aRow2['DEL_INDEX']); $oDataset2->next(); } //Delete the documents assigned to a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppDocumentPeer::APP_UID, $sAppUid); $oDataset2 = AppDocumentPeer::doSelectRS($oCriteria2); $oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset2->next(); while ($aRow2 = $oDataset2->getRow()) { $oAppDocument->remove($aRow2['APP_DOC_UID'], $aRow2['DOC_VERSION']); $oDataset2->next(); } //Delete the actions from a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppDelayPeer::APP_UID, $sAppUid); AppDelayPeer::doDelete($oCriteria2); //Delete the messages from a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppMessagePeer::APP_UID, $sAppUid); AppMessagePeer::doDelete($oCriteria2); //Delete the threads from a application $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(AppThreadPeer::APP_UID, $sAppUid); AppThreadPeer::doDelete($oCriteria2); //Before delete verify if is a child case $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(SubApplicationPeer::APP_UID, $sAppUid); $oCriteria2->add(SubApplicationPeer::SA_STATUS, 'ACTIVE'); if (SubApplicationPeer::doCount($oCriteria2) > 0) { G::LoadClass('derivation'); $oDerivation = new Derivation(); $oDerivation->verifyIsCaseChild($sAppUid); } //Delete the registries in the table SUB_APPLICATION $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(SubApplicationPeer::APP_UID, $sAppUid); SubApplicationPeer::doDelete($oCriteria2); $oCriteria2 = new Criteria('workflow'); $oCriteria2->add(SubApplicationPeer::APP_PARENT, $sAppUid); SubApplicationPeer::doDelete($oCriteria2); $oApp = new Application(); $result = $oApp->remove($sAppUid); //delete application from index if ($this->appSolr != null) { $this->appSolr->deleteApplicationSearchIndex($sAppUid); } return $result; } catch (exception $e) { throw $e; } }