public function testUpdateModel() { $form = new Admin_Form_Document_Section(); $model = $this->createTestDocument(); $form->updateModel($model); }
public function updateModel($document) { parent::updateModel($document); $datesHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Dates'); $document->setContributingCorporation($this->getElementValue(self::ELEMENT_CONTRIBUTING_CORPORATION)); $document->setCreatingCorporation($this->getElementValue(self::ELEMENT_CREATING_CORPORATION)); $document->setEdition($this->getElementValue(self::ELEMENT_EDITION)); $document->setIssue($this->getElementValue(self::ELEMENT_ISSUE)); $document->setPageFirst($this->getElementValue(self::ELEMENT_PAGE_FIRST)); $document->setPageLast($this->getElementValue(self::ELEMENT_PAGE_LAST)); $document->setPageNumber($this->getElementValue(self::ELEMENT_PAGE_COUNT)); $document->setPublisherName($this->getElementValue(self::ELEMENT_PUBLISHER_NAME)); $document->setPublisherPlace($this->getElementValue(self::ELEMENT_PUBLISHER_PLACE)); $document->setVolume($this->getElementValue(self::ELEMENT_VOLUME)); $value = $this->getElementValue(self::ELEMENT_THESIS_DATE_ACCEPTED); $date = is_null($value) ? null : $datesHelper->getOpusDate($value); $document->setThesisDateAccepted($date); $document->setThesisYearAccepted($this->getElementValue(self::ELEMENT_THESIS_YEAR_ACCEPTED)); $document->setBelongsToBibliography($this->getElementValue(self::ELEMENT_BELONGS_TO_BIBLIOGRAPHY)); }