<commit_before><?php

/*
 * This file is part of the League\Fractal package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace League\Fractal\Pagination;

/**
 * A paginator adapter for PhalconPHP/pagination.
 *
 * @author <NAME> <<EMAIL>>
 * 
 */
class PhalconFrameworkPaginatorAdapter implements PaginatorInterface
{
    /**
     * A slice of the result set to show in the pagination
     *
     * @var \Phalcon\Paginator\AdapterInterface
     */
    private $paginator;

    
    public function __construct($paginator)
    {
        $this->paginator = $paginator->getPaginate();
    }

    /**
     * Get the current page.
     *
     * @return int
     */
    public function getCurrentPage()
    {
        return $this->paginator->current;
    }

    /**
     * Get the last page.
     *
     * @return int
     */
    public function getLastPage()
    {
        return $this->paginator->last;
    }

    /**
     * Get the total.
     *
     * @return int
     */<commit_msg>Changed the paginator to not call getPaginate() upon construction to reduce the number of queries<commit_after><?php

/*
 * This file is part of the League\Fractal package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace League\Fractal\Pagination;

/**
 * A paginator adapter for PhalconPHP/pagination.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 *
 */
class PhalconFrameworkPaginatorAdapter implements PaginatorInterface
{
    /**
     * A slice of the result set to show in the pagination
     *
     * @var \Phalcon\Paginator\AdapterInterface
     */
    private $paginator;

    
    public function __construct($paginator)
    {
        $this->paginator = $paginator;
    }

    /**
     * Get the current page.
     *
     * @return int
     */
    public function getCurrentPage()
    {
        return $this->paginator->current;
    }

    /**
     * Get the last page.
     *
     * @return int
     */
    public function getLastPage()
    {
        return $this->paginator->last;
    }

    /**
     * Get the total.
     *
     * @return int
     */
{'fraction_non_alphanumeric': 0.11371527777777778, 'fraction_numerical': 0.0, 'mean_word_length': 2.21927374301676, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7315308', 'n_tokens_mistral': 697, 'n_tokens_neox': 695, 'n_words': 201}