public function removeOrganization() { //delete organization roles $this->removeOrganizationRoles(); $instance = new Alias(); foreach ($this->getAliases() as $instance) { $instance->delete(); } $instance = new Contact(); foreach ($this->getContacts() as $instance) { $instance->removeContactRoles(); $instance->delete(); } $instance = new ExternalLogin(); foreach ($this->getExternalLogins() as $instance) { $instance->delete(); } $instance = new IssueLog(); foreach ($this->getIssueLog() as $instance) { $instance->delete(); } //delete parent and child relationships $this->removeOrganizationHierarchy(); $this->delete(); }