Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
 /**
  * (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);
         }
     }
 }