/** * Aktualisiert Enrichment Modell mit Werten im Formular. * @param Opus_Enrichment $enrichment */ public function updateModel($enrichment) { $enrichment->setKeyName($this->getElementValue(self::ELEMENT_KEY_NAME)); $enrichment->setValue($this->getElementValue(self::ELEMENT_VALUE)); }
private function storeEnrichmentObject($dataKey, $dataValue) { $counter = $this->getCounter($dataKey); if ($counter != 0) { //remove possible counter $dataKey = str_replace('_' . $counter, '', $dataKey); } $this->_log->debug("try to store " . $dataKey . " with id: " . $dataValue); $keyName = str_replace('Enrichment', '', $dataKey); $enrichment = new Opus_Enrichment(); $enrichment->setValue($dataValue); $enrichment->setKeyName($keyName); try { $this->_document->addEnrichment($enrichment); } catch (Opus_Model_Exception $e) { $this->_log->err("could not add enrichment key {$keyName} with value {$dataValue} to document " . $this->_docId . " : " . $e->getMessage()); throw new Publish_Model_Exception(); } }