示例#1
0
 public function save($all = false)
 {
     foreach ($this->__Core->GetRawFields() as $field_name => $def) {
         $this->__HISTORY_YAPO->{$field_name} = $this->{$field_name};
     }
     $id = parent::save();
     $pk = $this->__HISTORY_YAPO->primarykey();
     $this->__HISTORY_YAPO->{$pk} = $id;
     $this->__HISTORY_YAPO->save();
     return $id;
 }
示例#2
0
 function next()
 {
     switch ($this->__NEXT_MODE) {
         case YapoTree::NEXT_DEFAULT:
             return parent::next();
         case YapoTree::NEXT_TREE:
             if (!parent::next()) {
                 if (count($this->__MODE_STACK) == 0) {
                     return false;
                 }
                 $pkid = array_shift($this->__MODE_STACK);
                 $stack = $this->__MODE_STACK;
                 $this->clear();
                 $this->__MODE_STACK = $stack;
                 $this->__NEXT_MODE = YapoTree::NEXT_TREE;
                 $parent = $this->__PARENT_FIELD;
                 $this->{$parent} = $pkid;
                 $size = $this->children();
             } else {
                 $pk = $this->primarykey();
                 $this->__MODE_STACK[] = $this->{$pk};
             }
             break;
     }
 }