public function removeResource() { //delete data from child linked tables $this->removeResourceRelationships(); $this->removePurchaseSites(); $this->removeAuthorizedSites(); $this->removeAdministeringSites(); $this->removeResourceLicenses(); $this->removeResourceLicenseStatuses(); $this->removeResourceOrganizations(); $this->removeResourcePayments(); $this->removeAllSubjects(); $this->removeAllIsbnOrIssn(); $instance = new Contact(); foreach ($this->getContacts() as $instance) { $instance->removeContactRoles(); $instance->delete(); } $instance = new ExternalLogin(); foreach ($this->getExternalLogins() as $instance) { $instance->delete(); } $instance = new ResourceNote(); foreach ($this->getNotes() as $instance) { $instance->delete(); } $instance = new Attachment(); foreach ($this->getAttachments() as $instance) { $instance->delete(); } $instance = new Alias(); foreach ($this->getAliases() as $instance) { $instance->delete(); } $this->delete(); }
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(); }
case 'testSushiService': //update if (isset($_GET['sushiServiceID']) && $_GET['sushiServiceID'] != '') { $sushiService = new SushiService(new NamedArguments(array('primaryKey' => $_GET['sushiServiceID']))); //try to run! try { echo $sushiService->runTest(); } catch (Exception $e) { echo $e->getMessage(); } } break; case 'deleteExternalLogin': $externalLogin = new ExternalLogin(new NamedArguments(array('primaryKey' => $_GET['externalLoginID']))); try { $externalLogin->delete(); } catch (Exception $e) { echo $e->getMessage(); } break; case 'submitOrganization': if (isset($_GET['publisherPlatformID']) && $_GET['publisherPlatformID'] != '') { $publisherPlatformID = $_GET['publisherPlatformID']; $platformID = ''; $obj = new PublisherPlatform(new NamedArguments(array('primaryKey' => $_GET['publisherPlatformID']))); } else { $publisherPlatformID = ''; $platformID = $_GET['platformID']; $obj = new Platform(new NamedArguments(array('primaryKey' => $_GET['platformID']))); } if (isset($_GET['organizationID'])) {