/** * Inserts or updates record in the underlying database * * @param string $nodeName Identifier of server which data comes from (used for harvesting) * @param string $viewGroup Name of the group for viewing (used for CENIA filters) * @param boolean $stopOnError If set true, insert no record if error occurs. Otherwise attempts to insert at least valid elements. * @return array Associative array with update results (both successful and failed records) */ function update($nodeName = '', $editGroup = '', $viewGroup = '', $public = 0, $stopOnError = true, $overwrite = 'all') { $importer = new MetadataImport($this->params['DEBUG']); $md = $importer->xml2array($this->xml, PHPPRG_DIR . "/../xsl/update2micka.xsl"); $c = new MdImport(); $c->setDataType($public); // nastavení veřejného záznamu if ($editGroup) { $c->group_e = $editGroup; } if ($viewGroup) { $c->group_v = $viewGroup; } $c->stop_error = $stopOnError; // pokud dojde k chybě při importu pokračuje $c->server_name = $nodeName; // jméno serveru ze kterého se importuje $c->setReportValidType('array', true); // formát validace $result = $c->dataToMd($md, $overwrite); if ($this->params['DEBUG'] == 1) { var_dump($result); } return $result; }