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(); }
} break; 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'])));
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(); }
$contactRoleProfile->contactRoleID = $id; $contactRoleProfile->save(); } } } catch (Exception $e) { echo $e->getMessage(); } break; case 'submitExternalLogin': //if this is an existing contact $externalLoginID = $_POST['externalLoginID']; if ($externalLoginID) { $externalLogin = new ExternalLogin(new NamedArguments(array('primaryKey' => $externalLoginID))); } else { //set up new external login $externalLogin = new ExternalLogin(); } $externalLogin->updateDate = date('Y-m-d H:i:s'); $externalLogin->externalLoginTypeID = $_POST['externalLoginTypeID']; $externalLogin->organizationID = $_POST['organizationID']; $externalLogin->loginURL = $_POST['loginURL']; $externalLogin->username = $_POST['username']; $externalLogin->emailAddress = $_POST['emailAddress']; $externalLogin->password = $_POST['password']; $externalLogin->noteText = $_POST['noteText']; try { $externalLogin->save(); } catch (Exception $e) { echo $e->getMessage(); } break;