vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Braintree;

use Iterator;

/**
 * Braintree PaginatedCollection
 * PaginatedCollection is a container object for paginated data
 *
 * Retrieves and pages through large collections of results
 *
 * example:
 * <code>
 * $result = MerchantAccount::all();
 *
 * foreach($result as $merchantAccount) {
 *   print_r($merchantAccount->status);
 * }
 * </code>
 */
class PaginatedCollection implements Iterator
{
    private $_pager;
    private $_pageSize;
    private $_currentPage;
    private $_index;
    private $_totalItems;
    private $_items;

    // phpcs:ignore PEAR.Commenting.FunctionComment.Missing
    public function __construct($pager)
    {
        $this->_pager = $pager;
        $this->_pageSize = 0;
        $this->_currentPage = 0;
        $this->_totalItems = 0;
        $this->_index = 0;
    }

    /**
     * Returns the current item when iterating with foreach
     *
     * @return object of the current item
     */
    #[\ReturnTypeWillChange]
    public function current()
    {
        return $this->_items[($this->_index % $this->_pageSize)];
    }

    /**
     * Returns null
     *
     * @return null
     */
    #[\ReturnTypeWillChange]
    public function key()
    {
        return null;
后面还有 68 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。