public function getNewBatch($limit = 0)
    {
        try {
            if (!is_numeric($limit) || $limit <= 0) {
                $limit = $this->limit;
            }
            return (new Query)
                    ->from($this->queueTable)
                    ->where(['status' => Email::STATUS_PENDING])
                    ->orderBy(['id' => SORT_ASC])
                    ->limit((int)$limit)
                    ->all($this->db);
        } catch (Exception $e) {
            Log::error($e->getMessage(), null, __METHOD__);
        }
    }
public function getNewBatch($limit = 0)
    {
        try {
            if (!is_numeric($limit) || $limit <= 0) {
                $limit = $this->limit;
            }
            return (new Query)
                    ->from($this->queueTable)
                    ->where(['status' => Email::STATUS_PENDING])
                    ->orderBy(['id' => SORT_ASC])
                    ->limit((int)$limit)
                    ->all($this->db);
        } catch (Exception $e) {
            Log::error($e->getMessage(), null, __METHOD__);
        }
    }
public function getNewBatch ( $ limit = 0 ) { try { if ( ! is_numeric ( $ limit ) || $ limit <= 0 ) { $ limit = $ this -> limit ; } return ( new Query ) -> from ( $ this -> queueTable ) -> where ( [ 'status' => Email :: STATUS_PENDING ] ) -> orderBy ( [ 'id' => SORT_ASC ] ) -> limit ( ( int ) $ limit ) -> all ( $ this -> db ) ; } catch ( Exception $ e ) { Log :: error ( $ e -> getMessage ( ) , null , __METHOD__ ) ; } }
Returns new batch of emails.
@param int $limit maximum number of rows in batch
@return array
Returns new batch of emails .