Пример #1
0
 public function take($length)
 {
     if ($this->isConverted === false && $this->data instanceof Collection) {
         return new self($this->data->take($length), $this->model, $this->repository, $this->options);
     }
     return parent::take($length);
 }
Пример #2
0
 /**
  * Return a new Collection with only the first x items.
  *
  * @param int $limit
  *
  * @return Collection
  */
 public function take($limit)
 {
     if ($this->data === null && is_string($this->sql) === false) {
         if ($this->sql->limit === false || $this->sql->limit >= $limit) {
             return new self($this->sql->limit($limit), $this->dbLink);
         }
     }
     return parent::take($limit);
 }