2012-06-25 13:04:51 +00:00
|
|
|
<?php
|
|
|
|
trait Dispatcher {
|
|
|
|
function insertNode(&$n) {
|
|
|
|
#MISSING: set this as parent
|
|
|
|
$n->insert();
|
|
|
|
$this->nodes[] = $n;
|
|
|
|
}
|
|
|
|
|
2012-06-25 20:00:02 +00:00
|
|
|
function removeNode($id) {#NAMENSKONFLIKT!!
|
2012-06-25 13:04:51 +00:00
|
|
|
$res = $this->getNode($id);
|
|
|
|
if($res != null) {
|
|
|
|
$res->delete_me();
|
|
|
|
$this->removeNode($res);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateNode($id,$data) {
|
|
|
|
$res = $this->getNode($id);
|
|
|
|
if($res != null) {
|
|
|
|
#MISSING: set new data
|
|
|
|
#
|
|
|
|
$res->update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function getNode($id) {
|
|
|
|
return $this->getIdx($id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|