public function delete() { if (!is_null($this->parent)) { $this->parent->removeChild($this->id); } $this->parent = null; }