コード例 #1
0
    /**
     * Remove List Participated History
     *
     * @param type $seqName
     * @return type
     * @throws type
     *
     */
    public function remove ($app_uid, $usr_uid, $del_index)
    {
        $existField = ListParticipatedLastPeer::retrieveByPK($app_uid, $usr_uid, $del_index);
        if (! is_null( $existField )) {
            $users = new Users();
            $users->refreshTotal($usr_uid, 'removed', 'participated');
        }
        $con = Propel::getConnection( ListParticipatedLastPeer::DATABASE_NAME );
        try {
            $this->setAppUid($app_uid);
            $this->setUsrUid($usr_uid);

            $con->begin();
            $this->delete();
            $con->commit();
        } catch (Exception $e) {
            $con->rollback();
            throw ($e);
        }
    }
コード例 #2
0
 /**
  * Remove List Participated History
  *
  * @param type $seqName
  * @return type
  * @throws type
  *
  */
 public function remove($app_uid, $usr_uid, $del_index)
 {
     try {
         $flagDelete = false;
         if (!is_null(ListParticipatedLastPeer::retrieveByPK($app_uid, $usr_uid, $del_index))) {
             $criteria = new Criteria("workflow");
             $criteria->add(ListParticipatedLastPeer::APP_UID, $app_uid);
             $criteria->add(ListParticipatedLastPeer::USR_UID, $usr_uid);
             $criteria->add(ListParticipatedLastPeer::DEL_INDEX, $del_index);
             $result = ListParticipatedLastPeer::doDelete($criteria);
             $flagDelete = true;
         } else {
             $criteria = new Criteria("workflow");
             $criteria->add(ListParticipatedLastPeer::APP_UID, $app_uid);
             $criteria->add(ListParticipatedLastPeer::USR_UID, $usr_uid);
             $rsCriteria = ListParticipatedLastPeer::doSelectRS($criteria);
             if ($rsCriteria->next()) {
                 $criteria2 = clone $criteria;
                 $result = ListParticipatedLastPeer::doDelete($criteria2);
                 $flagDelete = true;
             }
         }
         if ($flagDelete) {
             $user = new Users();
             $user->refreshTotal($usr_uid, "removed", "participated");
         }
     } catch (Exception $e) {
         throw $e;
     }
 }