function at($pos)
 {
     if (!($record = parent::at($pos))) {
         return null;
     }
     return self::createObjectFromRecord($record, $this->class_path, $this->conn, $this->lazy_attributes, $this->use_proxy);
 }
 function at($pos)
 {
     if (!($record = parent::at($pos))) {
         return null;
     }
     $this->_extractPrefixedFieldsAsActiveRecords($record);
     return $record;
 }
 function current()
 {
     $record = parent::current();
     $data = $record->export();
     $data['full'] = $this->prefix1 . $data['name'] . '-' . $data['job'] . $this->prefix2;
     $processed_record = new lmbSet();
     $processed_record->import($data);
     return $processed_record;
 }
 function rewind()
 {
     parent::rewind();
     if ($this->iterator->valid()) {
         $nested_array = array();
         $iterator = lmbTreeHelper::sort($this->iterator, $this->order_pairs, $this->node_field, $this->parent_field);
     } else {
         $iterator = new lmbCollection();
     }
     $this->iterator = $iterator;
     return $this->iterator->rewind();
 }
 function rewind()
 {
     parent::rewind();
     if ($this->iterator->valid()) {
         $nested_array = array();
         self::_doMakeNested($this->iterator, $nested_array);
         $iterator = new lmbCollection($nested_array);
     } else {
         $iterator = new lmbCollection();
     }
     $this->iterator = $iterator;
     return $this->iterator->rewind();
 }
 function current()
 {
     $object = parent::current();
     $fields = new lmbSet();
     foreach ($this->attach_relations as $relation_name => $params) {
         $relation_type = $this->base_object->getRelationType($relation_name);
         $relation_info = $this->base_object->getRelationInfo($relation_name);
         switch ($relation_type) {
             case lmbActiveRecord::HAS_ONE:
             case lmbActiveRecord::MANY_BELONGS_TO:
                 if (isset($this->loaded_attaches[$relation_name][$object->get($this->prefix . $relation_info['field'])])) {
                     $fields->set($this->prefix . $relation_name, $this->loaded_attaches[$relation_name][$object->get($this->prefix . $relation_info['field'])]);
                 }
                 break;
             case lmbActiveRecord::BELONGS_TO:
                 if (isset($this->loaded_attaches[$relation_name][$object->get($this->prefix . $this->base_object->getPrimaryKeyName())])) {
                     $fields->set($this->prefix . $relation_name, $this->loaded_attaches[$relation_name][$object->get($this->prefix . $this->base_object->getPrimaryKeyName())]);
                 }
                 break;
             case lmbActiveRecord::HAS_MANY:
             case lmbActiveRecord::HAS_MANY_TO_MANY:
                 $collection = $this->base_object->createRelationCollection($relation_name);
                 $collection->setOwner($object);
                 if (isset($this->loaded_attaches[$relation_name][$object->get($this->prefix . $this->base_object->getPrimaryKeyName())])) {
                     $collection->setDataset(new lmbCollection($this->loaded_attaches[$relation_name][$object->get($this->prefix . $this->base_object->getPrimaryKeyName())]));
                 } else {
                     $collection->setDataset(new lmbCollection());
                 }
                 $fields->set($this->prefix . $relation_name, $collection);
                 break;
         }
     }
     $object->loadFromRecord($fields);
     return $object;
 }
 function at($pos)
 {
     $record = parent::at($pos);
     $this->_processRecord($record);
     return $record;
 }
 function current()
 {
     $record = parent::current();
     $this->_process($record);
     return $record;
 }