getDeployment(); $submission = $deployment->getSubmission(); $localizedSetterMappings = $this->_getLocalizedSupplementaryFileSetterMappings(); if (isset($localizedSetterMappings[$node->tagName])) { // If applicable, call a setter for localized content. $setterFunction = $localizedSetterMappings[$node->tagName]; list($locale, $value) = $this->parseLocalizedContent($node); if (empty($locale)) $locale = $submission->getLocale(); if (count($submissionFiles) > 0) $submissionFiles[count($submissionFiles)-1]->$setterFunction($value, $locale); } else switch ($node->tagName) { case 'date_created': if (count($submissionFiles) > 0) $submissionFiles[count($submissionFiles)-1]->setDateCreated(strtotime($node->textContent)); break; case 'language': if (count($submissionFiles) > 0) $submissionFiles[count($submissionFiles)-1]->setLanguage($node->textContent); break; default: parent::handleChildElement($node, $stageId, $fileId, $submissionFiles); } } // // Helper functions // /** * Get node name to setter function mapping for localized data. * @return array */ function _getLocalizedSupplementaryFileSetterMappings() { return array( 'creator' => 'setCreator', 'subject' => 'setSubject', 'description' => 'setDescription', 'publisher' => 'setPublisher', 'sponsor' => 'setSponsor', 'source' => 'setSource', ); } } ?>