applications/vanilla/models/class.draftmodel.php
public function Get($UserID, $Offset = '0', $Limit = '', $DiscussionID = '') {
      if (!is_numeric($Offset) || $Offset < 0)
         $Offset = 0;

      if (!is_numeric($Limit) || $Limit < 1)
         $Limit = 100;
         
      $this->DraftQuery();
      $this->SQL
         ->Select('d.Name, di.Name', 'coalesce', 'Name')
         ->Join('Discussion di', 'd.discussionID = di.DiscussionID', 'left')
         ->Where('d.InsertUserID', $UserID)
         ->OrderBy('d.DateInserted', 'desc')
         ->Limit($Limit, $Offset);
         
      if (is_numeric($DiscussionID) && $DiscussionID > 0)
         $this->SQL->Where('d.DiscussionID', $DiscussionID);
      
      return $this->SQL->Get();
   }
public function Get($UserID, $Offset = '0', $Limit = '', $DiscussionID = '') {
      if (!is_numeric($Offset) || $Offset < 0)
         $Offset = 0;

      if (!is_numeric($Limit) || $Limit < 1)
         $Limit = 100;
         
      $this->DraftQuery();
      $this->SQL
         ->Select('d.Name, di.Name', 'coalesce', 'Name')
         ->Join('Discussion di', 'd.discussionID = di.DiscussionID', 'left')
         ->Where('d.InsertUserID', $UserID)
         ->OrderBy('d.DateInserted', 'desc')
         ->Limit($Limit, $Offset);
         
      if (is_numeric($DiscussionID) && $DiscussionID > 0)
         $this->SQL->Where('d.DiscussionID', $DiscussionID);
      
      return $this->SQL->Get();
   }
public function Get ( $ UserID , $ Offset = '0' , $ Limit = '' , $ DiscussionID = '' ) { if ( ! is_numeric ( $ Offset ) || $ Offset < 0 ) $ Offset = 0 ; if ( ! is_numeric ( $ Limit ) || $ Limit < 1 ) $ Limit = 100 ; $ this -> DraftQuery ( ) ; $ this -> SQL -> Select ( 'd.Name, di.Name' , 'coalesce' , 'Name' ) -> Join ( 'Discussion di' , 'd.discussionID = di.DiscussionID' , 'left' ) -> Where ( 'd.InsertUserID' , $ UserID ) -> OrderBy ( 'd.DateInserted' , 'desc' ) -> Limit ( $ Limit , $ Offset ) ; if ( is_numeric ( $ DiscussionID ) && $ DiscussionID > 0 ) $ this -> SQL -> Where ( 'd.DiscussionID' , $ DiscussionID ) ; return $ this -> SQL -> Get ( ) ; }
Gets drafts matching the given criteria.

@since 2.0.0
@access public

@param int $UserID Unique ID of user that wrote the drafts.
@param int $Offset Number of results to skip.
@param int $Limit Max number of drafts to return.
@param int $DiscussionID Limits drafts returned to a single discussion.
@return object Gdn_DataSet SQL results.
Gets drafts matching the given criteria .