當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Opus_Document::getCompletedDate方法代碼示例

本文整理匯總了PHP中Opus_Document::getCompletedDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Opus_Document::getCompletedDate方法的具體用法?PHP Opus_Document::getCompletedDate怎麽用?PHP Opus_Document::getCompletedDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Opus_Document的用法示例。


在下文中一共展示了Opus_Document::getCompletedDate方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCompletedDate

 public function getCompletedDate($yearOnly = false)
 {
     try {
         $date = $this->document->getCompletedDate();
         if (empty($date)) {
             $date = $this->document->getCompletedYear();
         }
         if ($yearOnly && !empty($date) && $date instanceof Opus_Date) {
             return htmlspecialchars($date->getYear());
         } else {
             return htmlspecialchars($date);
         }
     } catch (Exception $e) {
         return 'unknown';
     }
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:16,代碼來源:DocumentAdapter.php

示例2: getCompletedDate

 public function getCompletedDate($yearOnly = false)
 {
     $datesHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Dates');
     try {
         $date = $this->document->getCompletedDate();
         if (empty($date)) {
             $date = $this->document->getCompletedYear();
         }
         if (!empty($date) && $date instanceof Opus_Date) {
             if ($yearOnly) {
                 $date = $date->getYear();
             } else {
                 $date = $datesHelper->getDateString($date);
             }
         }
         return htmlspecialchars($date);
     } catch (Exception $e) {
         return 'unknown';
     }
 }
開發者ID:belapp,項目名稱:opus4-application,代碼行數:20,代碼來源:DocumentAdapter.php

示例3: testGetRecordOaiDcDoc114DcDate

 /**
  * Regression test for OPUSVIER-2378
  */
 public function testGetRecordOaiDcDoc114DcDate()
 {
     $doc = new Opus_Document(114);
     $completedDate = $doc->getCompletedDate();
     $this->assertEquals("2011-04-19", "{$completedDate}", "testdata changed");
     $this->dispatch('/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai::114');
     $this->assertResponseCode(200);
     $response = $this->getResponse();
     $badStrings = array("Exception", "Error", "Stacktrace", "badVerb");
     $this->checkForCustomBadStringsInHtml($response->getBody(), $badStrings);
     $xpath = $this->prepareXpathFromResultString($response->getBody());
     // Regression test for OPUSVIER-2378 (show <dc:date>)
     $elements = $xpath->query('//oai_dc:dc/dc:date');
     $this->assertEquals(1, $elements->length, "Unexpected count for dc:date");
     // Regression test for OPUSVIER-2378 (show <dc:date>2011-04-19)
     $elements = $xpath->query('//oai_dc:dc/dc:date[text()="2011-04-19"]');
     $this->assertEquals(1, $elements->length, "Unexpected count for dc:date");
 }
開發者ID:esmo,項目名稱:opus4-application,代碼行數:21,代碼來源:IndexControllerTest.php

示例4: populateFromModel

 /**
  * Befuellt das Formular anhand der Metadaten eines Dokuments.
  * @param Opus_Document $document
  */
 public function populateFromModel($document)
 {
     $datesHelper = $this->getDatesHelper();
     $this->getElement(self::ELEMENT_LANGUAGE)->setValue($document->getLanguage());
     $this->getElement(self::ELEMENT_TYPE)->setValue($document->getType());
     $date = $datesHelper->getDateString($document->getCompletedDate());
     $this->getElement(self::ELEMENT_COMPLETED_DATE)->setValue($date);
     $this->getElement(self::ELEMENT_COMPLETED_YEAR)->setValue($document->getCompletedYear());
     $date = $datesHelper->getDateString($document->getPublishedDate());
     $this->getElement(self::ELEMENT_PUBLISHED_DATE)->setValue($date);
     $this->getElement(self::ELEMENT_PUBLISHED_YEAR)->setValue($document->getPublishedYear());
     $date = $datesHelper->getDateString($document->getEmbargoDate());
     $this->getElement(self::ELEMENT_EMBARGO_DATE)->setValue($date);
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:18,代碼來源:General.php


注:本文中的Opus_Document::getCompletedDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。