public function setField($wmd) { // remove the old field related watermarking values if any $dwmvf = new DocmanWatermark_MetadataValueFactory(); $dwmvf->cleanFieldValuesByGroupId($wmd->getGroupId()); // set the new metadata as confidentiality field $dar = $this->dao->searchByGroupId($wmd->getGroupId()); if ($dar->valid()) { $this->dao->updateByGroupId($wmd->getGroupId(), $wmd->getId()); } else { $this->dao->createByGroupId($wmd->getGroupId(), $wmd->getId()); } }