コード例 #1
0
 /**
  * Process the task.
  */
 public function execute()
 {
     try {
         WpUsers::GetDatabase()->TransactionBegin();
         $intTimeBegin = time();
         do {
             $intTime = time();
             if (self::checkBreak($intTimeBegin)) {
                 break;
             }
             $objDleObjectArray = $this->get_objects_array($this->intOffset);
             if (!$objDleObjectArray) {
                 break;
             }
             foreach ($objDleObjectArray as $objDleObject) {
                 if (self::checkBreak($intTimeBegin)) {
                     break;
                 }
                 $this->process_object($objDleObject);
                 $this->intOffset++;
             }
             if (self::checkBreak($intTimeBegin)) {
                 break;
             }
         } while (true);
         $this->intTimeElapsed += time() - $intTimeBegin;
         WpUsers::GetDatabase()->TransactionCommit();
     } catch (QDatabaseExceptionBase $ex) {
         WpUsers::GetDatabase()->TransactionRollBack();
         throw $ex;
     } catch (QCallerException $ex) {
         WpUsers::GetDatabase()->TransactionRollBack();
         $ex->IncrementOffset();
         throw $ex;
     } catch (Exception $ex) {
         WpUsers::GetDatabase()->TransactionRollBack();
         throw $ex;
     }
 }
コード例 #2
0
    /**
     * Deletes all associated WpWtiLikePostsAsUser
     * @return void
     */
    public function DeleteAllWpWtiLikePostsAsUser()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateWpWtiLikePostAsUser on this unsaved WpUsers.');
        }
        // Get the Database Object for this Class
        $objDatabase = WpUsers::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`wp_wti_like_post`
				WHERE
					`user_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }