/** * Converts this iterator into an instance of Morph_Collection * * Note that this means all objects will be held in memory so * you need to be a bit careful not to exceed memory limits * * @return Morph_Collection */ public function toCollection() { $collection = new Morph_Collection(); $collection->setPermissableType($this->type); $collection->setTotalCount($this->totalCount()); $this->rewind(); foreach ($this as $object) { $collection->append($object); } return $collection; }
/** * (non-PHPdoc) * @see tao/classes/Morph/property/Morph_Property_Generic#__setRawValue() */ public function __setRawValue($value) { $collection = new Morph_Collection(); if (count($value) > 0) { foreach ($value as $item) { $object = new $this->Type(); $object->__setData($item, Morph_Object::STATE_CLEAN); $collection->append($object); } } }