function __construct($builder) { parent::__construct(); if ($builder instanceof Relation) { $this->builder = $builder->getBaseQuery(); $this->originalBuilder = clone $builder->getBaseQuery(); } else { $this->builder = $builder; $this->originalBuilder = clone $builder; } }
/** * @param Collection $collection */ function __construct(Collection $collection) { parent::__construct(); $this->collection = $collection; $this->workingCollection = $collection; }