Truncates the trace by a limit

@param int $limit
@return bool
193455
final public function truncateByLimit(int $limit): bool
    {
        if (count($this->props['items']) <= $limit) {
            return false;
        }
        $this->props['items'] = array_slice($this->props['items'], 0, $limit);
        return true;
    }
566200
public function getPending($limit = 10)
    {
        $results = $this->getCollection()
            ->find(array('processed' => false))
            ->limit($limit);

        return iterator_to_array($results);
    }
1214100
public function Truncate($Table = '') {
      if ($Table == '') {
         if (!isset($this->_Froms[0]))
            return FALSE;

         $Table = $this->_Froms[0];
      } else {
         $Table = $this->EscapeIdentifier($this->Database->DatabasePrefix . $Table);
      }

      $Sql = $this->GetTruncate($Table);
      $Result = $this->Query($Sql, 'truncate');
      return $Result;
   }
1064076
public function unread($limit = 5)
    {
        $unread = Auth::user()->unreadNotifications->take($limit);

        return $unread->map(function ($item) {
            return $this->toCollect($item);
        });
    }
13084
public function limit($start, $limit = null) {
        if ($limit === null) {
            $limit = intval($start);
            $start = 0;
        } else {
            $start = intval($start);
            $limit = intval($limit);
        }
        if ($start < 0) {
            $start = 0;
        }
        if (!$limit) {
            $limit = 1;
        }
        $this->limit = [$start, $limit];
        if ($this->statement) {
            $this->updateWhereData([':limit_0' => $start, ':limit_1' => $limit]);
        }

        return $this;
    }
224171
public function max($limit)
    {
        $result = $this->compare($limit, '>');
        $this->setValid($result);

        return $this;
    }
1289606
public static function truncate($s, $maxlength = null, $continue = "\xe2\x80\xa6", &$is_cutted = null, $tail_min_length = 20)
	{
		return self::str_limit($s, $maxlength, $continue, $is_cutted, $tail_min_length);
	}
1308747
public function truncate() {
		//connect to database
		$this->mapper->connect();
	
		//begin transaction
		$this->mapper->beginTransaction();
	
		//build query
		$query = $this->mapper->newQuery()
		->deleteFrom($this->entityProfile->getEntityTable());
			
		//run query
		$result = $query->exec();
	
		//commit
		$this->mapper->commit();
		return $result;
	}
933166
private function limitOffset($limit, $offset)
    {
        if (!$this->withoutTotalResultCount && !$this->count()) {
            return false;
        }

        $this->queryBuilder
            ->setFirstResult($offset)
            ->setMaxResults($limit);

        return true;
    }
909351
final public function truncate() {
      $this->connection();
      $this->sql = "TRUNCATE TABLE {$this->table};";

      if($this->driver=='firebird'||$this->driver=='sqlite')
         $this->sql = "DELETE FROM {$this->table};";

      // $this->fetch(false);
      $this->fetch();

      return $this->resultset?true:false;
   }
316247
public function formatLimitOffset($limit, $offset = 0) {
        if ($limit && $offset) {
            return sprintf($this->getClause(self::LIMIT_OFFSET), (int) $limit, (int) $offset);
        }

        return $this->formatLimit($limit);
    }
1316551
public function paginate($limit)
    {
        try {
            if (!is_null($this->query)) {

                $limit = request()->limit ?? $limit;
                $offset = request()->offset ?? 0;

                $this->query .= ' LIMIT '.$limit. ' OFFSET '.$offset;

                $statement = $this->connect->prepare($this->query);
                $statement->execute();
                return $statement->fetchAll();
            }

        } catch (\Exception $exception) {
            var_dump($exception->getMessage());
        }
    }
827919
public function limit($limit = 0)
	{
		if (is_null($this->limit))
		{
			$this->limit = new QueryElement('LIMIT', (int) $limit);
		}

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

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

        return $this;
    }
987836
public function limit($limit = 120, $end = '...') {
        $returnValue = $this->string;

        if($this->length() > $limit) {
            $returnValue = rtrim((string) $this->first($limit)->toString()) . $end;
        }

        return $this->createClone($returnValue);
    }
309644
protected function getLimit($limit = null)
    {
        if (null === $limit) {
            $limit = $this->getDefaultLimit();
        }

        return $this->validateLimit($limit);
    }