@param int $limit

@return int
978508
public function cleanExpireCodes($limit = 100)
    {
        $codeList = $this->getRepositoryManager()->getExpiredCodes($limit);
        $result = 0;
        if ($codeList) {
            $result = $this->cleanExpireCodes4List($codeList);
        }

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

        $this->limit = $limit;

        return $this;
    }
204918
public function setLimit($limit) {
        if (!is_numeric($limit) || $limit < 0) {
            throw new \InvalidArgumentException("Invalid limit '$limit.'", 500);
        }

        $this->limit = (int)$limit;
        return $this;
    }
411143
public function setLimit($limit)
    {
        $this->limit = (int)$limit;

        if ($this->total > 0 && $this->limit > 0) {
            $this->setPages(ceil($this->total / $limit));
        }

        return $this;
    }
1189682
public function actionNewPlain($limit = 10)
    {
        if ($limit === 'all') {
            $limit = null;
        } else {
            $limit = (int) $limit;
            if ($limit < 1) {
                throw new Exception("The limit must be greater than 0.");
            }
        }

        $migrations = $this->getNewMigrations();

        if (empty($migrations)) {
            echo 'None';
        } else {
            $n = count($migrations);
            echo "Found $n new " . ($n === 1 ? 'migration' : 'migrations') . ":\n";

            foreach ($migrations as $migration) {
                echo $migration . "\n";
            }
        }
    }
210972
public function limit($limit)
    {
        if (intval($limit) != $limit) {
            throw new \Exception('The limit must be an integer');
        }

        $this->limit = (int) $limit;

        return $this;
    }
479219
public static function limit($limit) {
        //1. limit(10);
        if ( is_numeric($limit) ) {
            return array(0, $limit);

            //2. limit("10, 50")
        } else if ( is_string( $limit ) ) {
            return explode(',', $limit);
        }
        return $limit;
    }
1105277
public function read($limit = 0)
    {
        $this->limit($limit);
        $query = $this->buildSelect();
        $this->run($query['query'], $query['param']);

        return $this->next();
    }
1193268
public function getOffset($limit = self::LIMIT, $order = 'desc') {
		if ($limit === 0) {
			return 0;
		}
		if ($order == 'asc' || $order == 'time_created::asc') {
			$before = $this->getCommentsBefore(array('count' => true, 'offset' => 0));
		} else {
			$before = $this->getCommentsAfter(array('count' => true, 'offset' => 0));
		}
		
		return floor($before / $limit) * $limit;
	}
35055
public function limit(int $limit): self
    {
        if (-1 > $limit) {
            throw new Exception(sprintf('%s() expects the limit to be greater or equal to -1, %s given', __METHOD__, $limit));
        }

        if ($limit === $this->limit) {
            return $this;
        }

        $clone = clone $this;
        $clone->limit = $limit;

        return $clone;
    }
128222
protected function getLength($limit)
    {
        $size = strlen($this->data);
        if ($limit <= 0) {
            $limit += $size;
        }

        if ($limit > $size) {
            return null;
        }

        $res = (string) substr($this->data, 0, $limit);
        $this->data = (string) substr($this->data, $limit);
        return $res;
    }
1190815
function limit($limit)
    {
        if (!empty($limit))
        {
            $_limit = explode(',', $limit, 2);
            if (count($_limit) == 2)
            {
                $this->limit = 'limit ' . (int)$_limit[0] . ',' . (int)$_limit[1];
            }
            else
            {
                $this->limit = "limit " . (int)$limit;
            }
        }
        else
        {
            $this->limit = '';
        }
    }
1021695
public function setLimit($limit)
    {
        if (!is_scalar($limit)) {
            $this->limit = self::DEFAULT_LIMIT;

            return $this;
        } else {
            $limit = (int)$limit;
        }

        if ($limit > self::MAX_LIMIT) {
            $this->limit = self::MAX_LIMIT;
        } elseif ($limit < 1) {
            $this->limit = self::DEFAULT_LIMIT;
        } else {
            $this->limit = $limit;
        }

        return $this;
    }
1016900
public function getTopThievesEntityData($limit = 10)
    {
        $topThieves = $this->gameDataService->getTopJobCharacter(2);

        return $topThieves->setMaxResults($limit)
            ->getQuery()
            ->getResult();
    }
888623
public function findEmailsToSend($limit = null)
    {
        $qb = $this->createQueryBuilder('se')
            ->where('se.status = :status AND (se.sentAt IS NULL OR se.sentAt <= :sentAt)')
            ->orderBy('se.sentAt', 'ASC')
            ->setParameter('status', SpoolEmailStatus::STATUS_WAITING)
            ->setParameter('sentAt', new \DateTime())
        ;

        if ($limit > 0) {
            $qb->setMaxResults($limit);
        }

        return $qb->getQuery()->getResult();
    }
520387
public function min($limit)
    {
        $result = $this->compare($limit, '<');
        $this->setValid($result);

        return $this;
    }
1007199
public function findAllCurrentIds($limit = 1000)
    {
        try {
            $queryBuilder = $this->getValidSpecialPriceQuery()
                ->select('specialPrice.id')
                ->addOrderBy('specialPrice.id', 'DESC');
            $query = $queryBuilder->getQuery()
                ->useResultCache(true, 3600);

            $ids = $query->getScalarResult();

            return array_column($ids, 'id');
        } catch (NoResultException $exc) {
            return null;
        }
    }