/** * Merge with another collection * * @param Collection $otherCollection * @return $this */ public function merge(Collection $otherCollection) { return $this->fillFromArray($otherCollection->toArray(), 'set'); }
/** * RTFN * * @return Collection|TestableObject[] */ protected function getCollectionForMerge() { $collection = new Collection(); for ($i = 7; $i <= 12; $i++) { $object = $this->getTestableObject(); $object->setId($i); $collection->add($object); } return $collection; }
/** * Handle collection error (throw Exception by default) * * @param string $message * @throws Exception */ public function handleError($message) { parent::handleError($message); }