public function execute($request) { $repositoryId = $request->repositoryId; $repository = QubitOaiRepository::getById($repositoryId); $this->repositoryName = $repository->getName(); $repository->delete(); }
protected function processForm() { if (0 < count(QubitOaiRepository::getByURI($this->form->getValue('uri')))) { $this->request->setAttribute('preExistingRepository', true); $this->forward('qtOaiPlugin', 'harvesterNewRepository'); } $oaiSimple = simplexml_load_file("{$this->form->getValue('uri')}?verb=Identify"); libxml_use_internal_errors(true); if ($oaiSimple) { $repository = new QubitOaiRepository(); $Identify = $oaiSimple->Identify; $repository->setName($Identify->repositoryName); $repository->setUri($this->form->getValue('uri')); $repository->setAdminEmail($Identify->adminEmail); $repository->setEarliestTimestamp($Identify->earliestDatestamp); $repository->save(); $harvest = new QubitOaiHarvest(); $harvest->setOaiRepository($repository); $harvest->setMetadataPrefix('oai_dc'); $harvest->save(); $this->redirect(array('module' => 'qtOaiPlugin', 'action' => 'harvesterNewRepository')); } else { $this->request->setAttribute('parsingErrors', true); $this->forward('qtOaiPlugin', 'harvesterNewRepository'); } }