function Delete() { if ($this->getUser() !== FALSE) { $this->StartTransaction(); $this->getFastTreeObject()->setTree($this->getHierarchyControl()); $this->getFastTreeObject()->delete($this->getUser(), 'RECURSE'); //FIXME: When deleting recursively, we don't clear out the hierarhcy share table for all the children. $hslf = new HierarchyShareListFactory(); Debug::Text(' Hierarchy Control ID: ' . $this->getHierarchyControl(), __FILE__, __LINE__, __METHOD__, 10); $hslf->getByHierarchyControlIdAndUserId($this->getHierarchyControl(), $this->getUser()); if ($hslf->getRecordCount() > 0) { Debug::Text(' Deleting already set shared flag ', __FILE__, __LINE__, __METHOD__, 10); $shared_obj = $hslf->getCurrent(); $shared_obj->Delete(); } else { Debug::Text(' NOT Deleting already set shared flag ', __FILE__, __LINE__, __METHOD__, 10); } TTLog::addEntry($this->getUser(), 30, TTi18n::getText('Hierarchy Tree - Control ID: ') . $this->getHierarchyControl(), NULL, $this->getTable()); $this->CommitTransaction(); return TRUE; } return FALSE; }