private static function applyObjID( WikiObjectModel $wom, WOMPageModel $root ) { $wom->setObjectID( $root->getNextId() ); $root->addToPageObjectSet( $wom ); if ( $wom instanceof WikiObjectModelCollection ) { foreach ( $wom->getObjects() as $obj ) { self::applyObjID( $obj, $root ); } } }
function updateObject( WikiObjectModel $obj, $id ) { $obj->setObjectID( $id ); $obj->setParent( $this ); $objs = array(); foreach ( $this->m_objects as $o ) { if ( $id == $o->getObjectID() ) { $objs[] = $obj; } else { $objs[] = $o; } } $this->m_objects = $objs; }
public function appendChildObject( WikiObjectModel $obj, $id = '' ) { if ( $id == '' ) { $p = $this; } else { $p = $this->m_page_objs[$id]; if ( !( $p instanceof WikiObjectModelCollection ) ) { return; } } $obj->setObjectID( $this->getNextId() ); $p->insertObject( $obj ); $this->addToPageObjectSet( $obj ); }