Paginates through news items stored on the WeChat servers.

@param int $offset - The offset from which to start showing items.
@param int $count - The number of items to show.

@return Paginated\NewsResultSet
@throws Exception
503463
public function paginateNews ($offset = 0, $count = 20)
    {
        $json = $this->paginate(MediaType::ARTICLE, $offset, $count);
        $resultSet = [];
        
        foreach ($json->item as $item) {
            $resultSet[] = $this->expandNews(
                $item->content->news_item,
                new Paginated\News($item->media_id, $item->update_time)
            );
        }

        return new Paginated\NewsResultSet($resultSet, $json->total_count, $offset);
    }
969110
public function mediaList($type, $offset = 0, $count = 20) {
        return $this->getMediaList()->parameters([
            'type' => $type,
            'offset' => $offset,
            'count' => $count
        ])->json();
    }
184737
public function searchRecords($query, $offset, $count)
    {
        return $this->fireEvent('data.searchRecords', [$query, $offset, $count], true);
    }
368442
public function getGroupList($begin = 0, $count = 10)
    {
        $url = "https://api.weixin.qq.com/shakearound/device/group/getlist?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['begin' => $begin, 'count' => $count]);
    }
862385
public function display($view, $count = 10)
    {
        $data = $this->calendar->scopeQuery(function ($query) use ($count) {
            return $query->where('status', '<>', 'Draft')->orderBy('id', 'DESC')->take($count);
        })->all();
        return view('calendar::admin.calendar.' . $view, compact('data'));
    }
443624
public function incrementPosition($count = 1)
    {
        if ($this->isNotInList()) return $this;

        $this->setListifyPosition($this->getListifyPosition() + $count);

        return $this;
    }
577788
public function limit($sql, $count, $offset = 0)
    {
        $count = intval($count);
        if ($count <= 0) {
            /**
             * @see Zend_Db_Adapter_Db2_Exception
             */
            // require_once 'Zend/Db/Adapter/Db2/Exception.php';
            throw new Zend_Db_Adapter_Db2_Exception("LIMIT argument count=$count is not valid");
        }

        $offset = intval($offset);
        if ($offset < 0) {
            /**
             * @see Zend_Db_Adapter_Db2_Exception
             */
            // require_once 'Zend/Db/Adapter/Db2/Exception.php';
            throw new Zend_Db_Adapter_Db2_Exception("LIMIT argument offset=$offset is not valid");
        }

        if ($offset == 0) {
            $limit_sql = $sql . " FETCH FIRST $count ROWS ONLY";
            return $limit_sql;
        }

        /**
         * DB2 does not implement the LIMIT clause as some RDBMS do.
         * We have to simulate it with subqueries and ROWNUM.
         * Unfortunately because we use the column wildcard "*",
         * this puts an extra column into the query result set.
         */
        $limit_sql = "SELECT z2.*
            FROM (
                SELECT ROW_NUMBER() OVER() AS \"ZEND_DB_ROWNUM\", z1.*
                FROM (
                    " . $sql . "
                ) z1
            ) z2
            WHERE z2.zend_db_rownum BETWEEN " . ($offset+1) . " AND " . ($offset+$count);
        return $limit_sql;
    }
314628
protected function getListReportRoute($count = false)
    {
        $list = $this->route->getList();
        $this->prepareListReportRoute($list);
        $allowed = $this->getAllowedFiltersReportRoute();

        $this->filterList($list, $allowed, $this->query_filter);
        $this->sortList($list, $allowed, $this->query_filter, array('pattern' => 'asc'));

        if ($count) {
            return count($list);
        }

        $this->limitList($list, $this->data_limit);
        return $list;
    }
289939
private function read($count) {
        $count = abs($count);

        if ($count > 0) {
            return fread($this->STREAM, $count);
        }

        return NULL;
    }
1271956
function stream_read($count) {
        $ret = substr($this->_data, $this->_position, $count);
        $this->_position += strlen($ret);
        return $ret;
    }
1340011
private function readPoints($count)
    {
        $points = array();

        for ($i = 0; $i < $count; $i++) {
            $points[] = $this->point();
        }

        return $points;
    }
347420
public function iterNextPage($count = 3)
    {
        if ($this->getPage() == 1 && $this->getPagesCount() >= $count * 2) {
            $count *= 2;
        }
        $pages = [];
        foreach (range(1, $count) as $i) {
            $page = $this->getPage() + $i;
            if ($page <= $this->getPagesCount()) {
                $pages[] = $page;
            }
        }

        return $pages;
    }
300041
public function limit($count, $offset = 0)
    {
        $this->limit = array((int) $count, (int) $offset);

        return $this;
    }
395988
public function batchGetCardLocation($offset = 0, $count = 0)
    {
        return $this->auth(function () use ($offset, $count) {
            $data = json_encode(['offset' => $offset, 'count' => $count], JSON_UNESCAPED_UNICODE);
            $result = $this->http->postJson(
                $this->baseUrl . 'card/location/batchget?access_token=' . $this->accessToken,
                $data
            );

            return $result;
        });
    }
698593
public function withFeatured(int $count = 1)
    {
        if (!$items = $this->get('items')) {
            $this->append('featured', []);

            return $this;
        }

        $featured = $items->shift();

        $this->content['items'] = $items;
        $this->append('featured', [$featured]);

        return $this;
    }
446552
public function setParcelCount($count)
    {
        $this->set(Config::T8905, (string)$count);
        $this->set(Config::T8702, (string)$count);

        return $this;
    }
678316
public function paginateRaw($count, $page, $itemsPerPage)
    {
        $this->paginator->tweak($count, $itemsPerPage, $page);
        $this->limit($this->paginator->countOffset(), $this->paginator->getItemsPerPage());

        return $this;
    }