22 $this->oldParentId = $this->parent_id;
34 if ($this->oldParentId != $this->parent_id) {
36 $acoClass =
new CGroup();
38 $aco = $acoClass->loadObject($this);
40 throw new RuntimeException(
'Aco-object does not exist');
43 if($this->oldParentId !== NULL){
44 if (!$aco->leave(array(
'model' => get_class($this),
'foreign_key' => $this->oldParentId)))
45 throw new RuntimeException(
'Unable to leave old parent-aco-object');
49 if($this->parent_id !== NULL){
50 $aco2 = $acoClass->loadObject(
51 array(
'model' => get_class($this),
'foreign_key' => $this->parent_id));
52 if (!$aco->join($aco2))
53 throw new RuntimeException(
'Unable to choose new parent-aco');
57 $this->oldParentId = $this->parent_id;