/** * Checks if a enrichmentkey already used. * @param string $login * @return boolean */ protected function _isEnrichmentKeyUsed($name) { $enrichmentkey = Opus_EnrichmentKey::fetchByName($name); if (is_null($enrichmentkey)) { return false; } return true; }
private function isValidEnrichmentKey($elementName) { $enrichment = Opus_EnrichmentKey::fetchByName($elementName); if (is_null($enrichment)) { throw new Publish_Model_FormIncorrectEnrichmentKeyException($elementName); } return true; }
/** * Checks if a enrichmentkey already used. * @param string $login * @return boolean */ protected function _isEnrichmentKeyUsed($name) { $enrichmentkey = Opus_EnrichmentKey::fetchByName($name); return !is_null($enrichmentkey); }
public function testNoMigrationToEnrichments() { $this->assertNull(Opus_EnrichmentKey::fetchByName('SubjectUncontrolledEnglish')); $this->assertNull(Opus_EnrichmentKey::fetchByName('SubjectUncontrolledGerman')); $this->assertNull(Opus_EnrichmentKey::fetchByName('SubjectSwd')); }
private function createNewEnrichmentKeys() { $elements = $this->document->getElementsByTagName('Enrichment'); foreach ($elements as $e) { $keyname = $e->getAttribute('KeyName'); if (is_null(Opus_EnrichmentKey::fetchByName($keyname))) { $enrichmentkey = new Opus_EnrichmentKey(); $enrichmentkey->setName($keyname); $enrichmentkey->store(); } } }
/** * Deletes an enrichmentkey from the database. */ public function deleteAction() { $name = $this->getRequest()->getParam('name'); if (!is_null(Opus_EnrichmentKey::fetchByName($name)) && !in_array($name, $this->protectedEnrichmentkeys)) { $enrichmentkey = new Opus_EnrichmentKey($name); $enrichmentkey->delete(); } $this->_helper->redirector('index'); }
public function testNoMigrationToNotes() { $this->assertNull(Opus_EnrichmentKey::fetchByName('BemExtern')); }