Populate the submission object from the node
public populateObject ( $submission, $node ) : Submission | ||
$submission | Submission | |
$node | DOMElement | |
return | Submission |
/** * Populate the submission object from the node * @param $submission Submission * @param $node DOMElement * @return Submission */ function populateObject($submission, $node) { $sectionAbbrev = $node->getAttribute('section_ref'); if ($sectionAbbrev !== '') { $sectionDao = DAORegistry::getDAO('SectionDAO'); $section = $sectionDao->getByAbbrev($sectionAbbrev, $submission->getContextId()); if (!$section) { fatalError('Could not find a section with the path "' . $sectionAbbrev . '"!'); } $submission->setSectionId($section->getId()); } return parent::populateObject($submission, $node); }
/** * Populate the submission object from the node * @param $submission Submission * @param $node DOMElement * @return Submission */ function populateObject($submission, $node) { $seriesPath = $node->getAttribute('series'); $seriesPosition = $node->getAttribute('series_position'); if ($seriesPath !== '') { $seriesDao = DAORegistry::getDAO('SeriesDAO'); $series = $seriesDao->getByPath($seriesPath, $submission->getContextId()); if (!$series) { fatalError('Could not find a series with the path "' . $seriesPath . '"!'); } $submission->setSeriesId($series->getId()); $submission->setSeriesPosition($seriesPosition); } $workType = $node->getAttribute('work_type'); $submission->setWorkType($workType); return parent::populateObject($submission, $node); }
/** * Populate the submission object from the node * @param $submission Submission * @param $node DOMElement * @return Submission */ function populateObject($submission, $node) { $deployment = $this->getDeployment(); $seriesPath = $node->getAttribute('series'); $seriesPosition = $node->getAttribute('series_position'); if ($seriesPath !== '') { $seriesDao = DAORegistry::getDAO('SeriesDAO'); $series = $seriesDao->getByPath($seriesPath, $submission->getContextId()); if (!$series) { $deployment->addError(ASSOC_TYPE_SUBMISSION, $submission->getId(), __('plugins.importexport.native.error.unknownSeries', array('param' => $seriesPath))); } else { $submission->setSeriesId($series->getId()); $submission->setSeriesPosition($seriesPosition); } } $workType = $node->getAttribute('work_type'); $submission->setWorkType($workType); return parent::populateObject($submission, $node); }
/** * Populate the submission object from the node * @param $submission Submission * @param $node DOMElement * @return Submission */ function populateObject($submission, $node) { $deployment = $this->getDeployment(); $sectionAbbrev = $node->getAttribute('section_ref'); if ($sectionAbbrev !== '') { $sectionDao = DAORegistry::getDAO('SectionDAO'); $section = $sectionDao->getByAbbrev($sectionAbbrev, $submission->getContextId()); if (!$section) { $deployment->addError(ASSOC_TYPE_SUBMISSION, $submission->getId(), __('plugins.importexport.native.error.unknownSection', array('param' => $sectionAbbrev))); } else { $submission->setSectionId($section->getId()); } } return parent::populateObject($submission, $node); }