Cake\Controller\Component\PaginatorComponent::checkLimit PHP 메소드

checkLimit() 공개 메소드

Check the limit parameter and ensure it's within the maxLimit bounds.
public checkLimit ( array $options ) : array
$options array An array of options with a limit key to be checked.
리턴 array An array of options for pagination
    public function checkLimit(array $options)
    {
        $options['limit'] = (int) $options['limit'];
        if (empty($options['limit']) || $options['limit'] < 1) {
            $options['limit'] = 1;
        }
        $options['limit'] = max(min($options['limit'], $options['maxLimit']), 1);
        return $options;
    }