Set or overwrite the number of items that is requested from the Last.fm API.

@param int $limit

@return $this
349516
public function limit(int $limit)
    {
        $this->query = array_merge($this->query ?? [], ['limit' => $limit]);

        return $this;
    }
972974
public function limit($limit, $start = null)
    {
        if(is_int($limit)) {
            $build = $limit;
            if(is_int($start)) {
                $build = $start.', '.$limit;
            }
            $this->limit = ' LIMIT '.$build;
        }
        return $this;
    }
160534
public function setLimit($limit) {
        if(is_numeric($limit))
            $this->items_per_page = $limit;
        $this->setCurrent( self::findCurrentPage($this->routeKey));
    }
1306274
final public function limit(int $amount = null)
    {
        $this->limitAmount = $amount === null ? null : $amount;

        return $this;
    }
853676
public function limit($limit)
    {
        Assertion::integer($limit);
        Assertion::range($limit, 1, 50);

        $this->limit = $limit;

        return $this;
    }
486057
public function limit($limit)
    {
        if ($limit === null) {
            unset($this->parameters['Limit']);
        } else {
            $this->parameters['Limit'] = $limit;
        }

        return $this;
    }
1369685
public function limit($limit) {
        if ( $limit ) {
            $this->limit = $limit;
        } else {
            //推荐列表查询一定是要分页的，如果没有分页则显示前1000条
            $this->limit = '0, '.self::PAGE_SIZE;
        }
        return $this;
    }
1197495
public function limit($limit, $offset = null)
    {
        $this->_limit = $limit > 0 ? (int)$limit : null;
        $this->_offset = $offset > 0 ? (int)$offset : null;

        return $this;
    }
1079486
public function withLimit(int $limit): self
    {
        $paginator = clone $this;
        $paginator->limit = $limit;

        return $paginator;
    }
550873
public function load(int $offset = 0, int $limit = 25): self
    {
        $this->data = array_map(
            function (Location $location) {
                return $this->valueFactory->createBookmark($location);
            },
            $this->bookmarkService->loadBookmarks($offset, $limit)->items
        );

        return $this;
    }
378458
public function limit($limit)
    {
        $limit = (int)$limit;
        $limit < 1 && $limit = 1;
        return $this->add('limit', $limit);
    }
719475
public function limitHistory($limit)
    {
        $this->historyLimit = $limit === null ? null : $limit;

        // limit send and currently exceeded
        if ($this->historyLimit !== null && isset($this->historyLines[$this->historyLimit])) {
            // adjust position in history according to new position after applying limit
            if ($this->historyPosition !== null) {
                $this->historyPosition -= count($this->historyLines) - $this->historyLimit;

                // current position will drop off from list => restore original
                if ($this->historyPosition < 0) {
                    $this->setInput($this->historyUnsaved);
                    $this->historyPosition = null;
                    $this->historyUnsaved = null;
                }
            }

            $this->historyLines = array_slice($this->historyLines, -$this->historyLimit, $this->historyLimit);
        }

        return $this;
    }
813337
protected function addLimit($limit, $offset = null) {
        $limitQuery = '';

        if (intval($limit) > 0) {
            $limitQuery .= $this->getDriverEscaper()->dbCommand('LIMIT') . ' ' . $limit;  
            if (!is_null($offset)) {
                $limitQuery .= ' ' . $this->getDriverEscaper()->dbCommand('OFFSET') . ' ' . $offset;
            }
        }
        

        return $limitQuery;
    }
1193093
public function setLimit($limit)
    {
        if (is_array($limit)) {
            $spec = $limit;
            if (!isset($spec['name'])) {
                throw new \Exception("Cannot create Limit: Name missing from configuration.");
            }
            $name = $spec['name'];
            $limit = isset($spec['limit']) ? $spec['limit'] : null;
            $interval = isset($spec['interval']) ? $spec['interval'] : null;
            $actions = isset($spec['actions']) ? $spec['actions'] : array();
            
            $limit = new Limit($name, $limit, $interval);
            
            foreach ($actions as $action) {
                if (is_string($action)) {
                    $action = $this->getActionPlugins()->get($action);
                } elseif (is_array($action)) {
                    if (!isset($action['name'])) {
                        throw new \Exception('Cannot create Action: Name missing from configuration.');
                    }
                    $action = $this->getActionPlugins()->get($action['name'], $action);
                }
                
                if (!$action instanceof Action\ActionInterface) {
                    throw new \Exception("Action must be instance of Spork\Mvc\Listener\Limit\Action\ActionInterface");
                }
                
                $limit->addAction($action);
            }
        }
        
        if (!$limit instanceof Limit) {
            throw new \Exception("Limit must be instance of Spork\Mvc\Listener\Limit\Limit");
        }
        
        $this->limits[$limit->getName()] = $limit;
    }
1084243
public function limit($limit)
    {
        if (null !== $limit) {
            if (!is_numeric($limit) || $limit != (int) $limit) {
                throw new \InvalidArgumentException('The limit is not valid.');
            }
            $limit = (int) $limit;
        }

        $this->limit = $limit;

        return $this;
    }
885578
public function setLimit($limit)
    {
        $this->limit = $limit > 0 ? $limit : 1;

        $this->setPage($this->page);
    }
401917
public function limit($limit, $offset = null)
    {
        $self              = self::getInstance();
        $offset            = (!empty($offset)) ? 'OFFSET '.$offset : null;
        $self->optionLimit = " LIMIT {$limit} ".$offset;

        return $self;
    }