@param int $limit
@param string|null $field

@return \PSolr\Request\Facet

@see http://wiki.apache.org/solr/SimpleFacetParameters#facet.limit
347377
public function setLimit($limit, $field = null)
    {
        $param = $this->buildParam('facet.limit', $field);
        return $this->set($param, $limit);
    }
211162
public function limit($limit = null) {
		if (is_null($limit)) //remove options
			return $this->discard('query.limit');
	
		return $this->merge(['query.limit' => intval($limit)]);
	}
967051
public function getField($field)
	{
		$result = $this->client->get("fields/{$field}");
		return $result ? new Resources\Field($this, $result) : null;
	}
425998
public function limit($limit, $offset = null) {
		$this->_criteria->limit($limit, $offset);
		$this->_limit = (int) $limit;
				
		return $this;
	}
401917
public function limit($limit, $offset = null)
    {
        $self              = self::getInstance();
        $offset            = (!empty($offset)) ? 'OFFSET '.$offset : null;
        $self->optionLimit = " LIMIT {$limit} ".$offset;

        return $self;
    }
278284
public function getLimit($max = null)
    {
        $limit = $this->getPage('limit') ?: $this->getPage('size') ?: null;

        if ($limit && $max) {
            $limit = min($max, $limit);
        }

        return $limit;
    }
88565
public function allowField($field)
    {
        if (is_string($field)) {
            $field = explode(',', $field);
        }

        $this->field = $field;

        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;
    }
1147586
public function limit($offset, $amount = null)
    {
        $this->queryBuilder->limit($offset, $amount);
        return $this;
    }
612010
public function getValueList($field, $search = '', $limit = 10, $start = 0)
    {
        $fieldModel = $this->fieldModel;

        // get list of extendedFields
        if ($extendedField = $this->getExtendedField($field)) {
            $dataType   = $fieldModel->getSchemaDefinition(
                $extendedField['alias'],
                $extendedField['type']
            );
            $dataType   = $dataType['type'];
            $secure     = 'extendedFieldSecure' === $extendedField['object'] ? '_secure' : '';
            $table      = MAUTIC_TABLE_PREFIX.'lead_fields_leads_'.$dataType.$secure.'_xref';
            $alias      = $dataType.$extendedField['id'];
            $col        = $alias.'.value';
            $q          = $this->getEntityManager()->getConnection()->createQueryBuilder();
            $q->select("DISTINCT $col")
                ->from($table, $alias)
                ->where($alias.'.lead_field_id = :fieldid')
                ->setParameter('fieldid', $extendedField['id']);
            if (!empty($search)) {
                $q->andWhere("$col LIKE :search")
                    ->setParameter('search', "{$search}%");
            }

            $q->orderBy($col);

            if (!empty($limit)) {
                $q->setFirstResult($start)
                    ->setMaxResults($limit);
            }

            $results = $q->execute()->fetchAll();
        } else {
            // The following is same as core CustomFieldRepositoryTrait::getValueList()
            // Includes prefix
            // hardcodes the lead table if its not Extended Field
            $col   = 'l.'.$field;
            $q     = $this->getEntityManager()->getConnection()->createQueryBuilder()
                ->select("DISTINCT $col")
                ->from('leads', 'l');

            $q->where(
                $q->expr()->andX(
                    $q->expr()->neq($col, $q->expr()->literal('')),
                    $q->expr()->isNotNull($col)
                )
            );

            if (!empty($search)) {
                $q->andWhere("$col LIKE :search")
                    ->setParameter('search', "{$search}%");
            }

            $q->orderBy($col);

            if (!empty($limit)) {
                $q->setFirstResult($start)
                    ->setMaxResults($limit);
            }

            $results = $q->execute()->fetchAll();
        }

        return $results;
    }
1362526
public function limit($limit, $offset = null)
    {
        $this->q['limit']['limit'] = $limit;

        if (isset($offset)) {
            $this->q['limit']['offset'] = $offset;
        }

        return $this;
    }
1254196
public function limit( $limit )
    {
        $limit = (int)$limit;
        if( $limit > 0 )
            $this->limit = $limit;

        return $this;
    }
343099
public function limit($limit, $limit2 = null)
    {
        if (!is_null($limit2)) 
        {
            $this->offset = (int) $limit;
            $this->limit = (int) $limit2;
        } else {
            $this->limit = (int) $limit;
        }

        return $this;
    }
495276
public function setLimit($limit) {
        if (!is_numeric($limit)) {
            $limit = self::DEFAULT_LIMIT;
        }

        if (0 == $limit) {
            // Display ALL Results - No Limit!
            $limit = null;
        }

        $this->limit = $limit;

        return $this;
    }
994986
public function fetchByField($field, $value, $limit = null, $order = null, $offset = null, &$count = false)
    {
        $fetch = $this->getBaseFetch()
            ->where()
            ->equal($field, ':' . $field);
        $parameters = array(':' . $field => $value);
        return $this->fetch($fetch, $parameters, $limit, $order, $offset, $count);
    }
55104
public function search($fields, $limit = -1)
    {
        if (!is_array($fields)) {
            $fields = array($this->getIndex() => $fields);
        }

        $fieldsValue = $fields;
        $fields = $this->getFields();
        $sql = '';
        $args = array();
        foreach ($fields as $field) {
            if (isset($fieldsValue[$field])) {
                $value = $fieldsValue[$field];
                if ($this->isString($field)) {
                    $sql .= '`' . $field . '` LIKE ? OR ';
                    $args[] = '%' . $value . '%';
                } else {
                    $sql .= '`' . $field . '` = ? OR ';
                    $args[] = $value;
                }
            }
        }
        if (!empty($sql)) {
            $sql = substr($sql, 0, -4);
            if($limit > 0) {
                $sql .= " LIMIT $limit";
            }
            return $this->build($this->db->select('SELECT * FROM `' . $this->table_name . '` WHERE ' . $sql, $args));
        }
        return $this->build(array());
    }
267158
public function limit($offset = null, $limit = null)
    {
    	$args = func_get_args();
    	if (count($args) === 0) {
    		throw new Exception('At least 1 argument');
    	}
    	if (count($args) == 1) {
    		$this->limit =  $args[0];
    	} else {
    		list($this->offset, $this->limit) = $args;
    	}
        return $this;
    }