当前位置: 首页>>代码示例>>PHP>>正文


PHP DAO::formatDateToDB方法代码示例

本文整理汇总了PHP中DAO::formatDateToDB方法的典型用法代码示例。如果您正苦于以下问题:PHP DAO::formatDateToDB方法的具体用法?PHP DAO::formatDateToDB怎么用?PHP DAO::formatDateToDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DAO的用法示例。


在下文中一共展示了DAO::formatDateToDB方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setDateExpire

 /**
  * @copydoc PKPAnnouncementForm::setDateExpire()
  */
 function setDateExpire(&$announcement)
 {
     /* @var $announcement Announcement */
     $dateExpire = $this->getData('dateExpire');
     if ($dateExpire) {
         $announcement->setDateExpire(DAO::formatDateToDB($dateExpire, null, false));
     } else {
         // No date passed but null is acceptable for
         // announcements.
         $announcement->setDateExpire(null);
     }
     return true;
 }
开发者ID:jalperin,项目名称:ojs,代码行数:16,代码来源:AnnouncementForm.inc.php

示例2: setDueDates

 /**
  * Sets the due date for a review assignment.
  * @param $request PKPRequest
  * @param $submission Submission
  * @param $reviewId int
  * @param $dueDate string
  * @param $numWeeks int
  * @param $logEntry boolean
  */
 function setDueDates($request, $submission, $reviewAssignment, $reviewDueDate = null, $responseDueDate = null, $logEntry = false)
 {
     $userDao = DAORegistry::getDAO('UserDAO');
     $context = $request->getContext();
     $reviewer = $userDao->getById($reviewAssignment->getReviewerId());
     if (!isset($reviewer)) {
         return false;
     }
     if ($reviewAssignment->getSubmissionId() == $submission->getId() && !HookRegistry::call('EditorAction::setDueDates', array(&$reviewAssignment, &$reviewer, &$reviewDueDate, &$responseDueDate))) {
         // Set the review due date
         $defaultNumWeeks = $context->getSetting('numWeeksPerReview');
         $reviewAssignment->setDateDue(DAO::formatDateToDB($reviewDueDate, $defaultNumWeeks, false));
         // Set the response due date
         $defaultNumWeeks = $context->getSetting('numWeeksPerReponse');
         $reviewAssignment->setDateResponseDue(DAO::formatDateToDB($responseDueDate, $defaultNumWeeks, false));
         // update the assignment (with both the new dates)
         $reviewAssignment->stampModified();
         $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
         /* @var $reviewAssignmentDao ReviewAssignmentDAO */
         $reviewAssignmentDao->updateObject($reviewAssignment);
         // N.B. Only logging Date Due
         if ($logEntry) {
             // Add log
             import('lib.pkp.classes.log.SubmissionLog');
             import('classes.log.SubmissionEventLogEntry');
             SubmissionLog::logEvent($request, $submission, SUBMISSION_LOG_REVIEW_SET_DUE_DATE, 'log.review.reviewDueDateSet', array('reviewerName' => $reviewer->getFullName(), 'dueDate' => strftime(Config::getVar('general', 'date_format_short'), strtotime($reviewAssignment->getDateDue())), 'submissionId' => $submission->getId(), 'stageId' => $reviewAssignment->getStageId(), 'round' => $reviewAssignment->getRound()));
         }
     }
 }
开发者ID:doana,项目名称:pkp-lib,代码行数:38,代码来源:EditorAction.inc.php


注:本文中的DAO::formatDateToDB方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。