public function skip($length) { if ($this->isConverted === false && $this->data instanceof Collection) { return new self($this->data->skip($length), $this->model, $this->repository, $this->options); } return parent::skip($length); }
/** * Return a new Collection without the first x items. * * @param int $offset * * @return Collection */ public function skip($offset) { if ($this->data === null && is_string($this->sql) === false) { $sql = clone $this->sql; $sql->offset += $offset; // Add to the current offset. if ($sql->limit === false) { return new self($sql, $this->dbLink); } else { $sql->limit -= $offset; if ($sql->limit <= 0) { // Will all entries be skipped? return new Collection(array()); // return an empty collection } return new self($sql, $this->dbLink); } } return parent::skip($offset); }