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


PHP Meeting::getID方法代码示例

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


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

示例1: getPreviousMeeting

 /**
  * A method to get a meeting that is before the one that is provided as a parameter
  * @param Meeting $meeting the meeting after the one that should be returned
  * @return Meeting|null the previous meeting
  */
 public static function getPreviousMeeting($meeting)
 {
     # Get database connection
     $objPDO = PDOFactory::get();
     # Get project ID from session
     $projectId = HTTPSession::getInstance()->PROJECT_ID;
     # Get the previous meeting, which we can recognize by
     # 1. datetime of that meeting is less than meeting provided
     # 2. Meeting is not deleted, however can be cancelled, because we might look for a meeting that was cancelled
     # 3. Meeting is approved
     $strQuery = "SELECT id FROM Meeting WHERE project_id = :project_id\n                      AND datetime < (SELECT datetime FROM Meeting WHERE id = " . $meeting->getID() . ")\n                      AND is_deleted = 0\n                      AND is_approved = 1\n                      ORDER BY datetime DESC\n                      LIMIT 1";
     $objStatement = $objPDO->prepare($strQuery);
     $objStatement->bindValue(':project_id', $projectId, PDO::PARAM_INT);
     $objStatement->execute();
     # Define empty variable
     $prevMeeting = null;
     # Get the previous meeting if it exists
     if ($row = $objStatement->fetch(PDO::FETCH_ASSOC)) {
         $prevMeeting = new Meeting($row['id']);
     }
     # The previous meeting
     return $prevMeeting;
 }
开发者ID:emilcieslar,项目名称:student-supervisor,代码行数:28,代码来源:MeetingFactory.php

示例2: checkAuthTwoMeetingsInRow

 /**
  * A method to deny access if user is trying to cancel two meetings in a row
  * @param Meeting $meeting the meeting object
  * @param null $error if error should be displayed
  */
 protected function checkAuthTwoMeetingsInRow($meeting, $error = null)
 {
     # Two meetings in a row cannot be cancelled, if previous meeting was cancelled
     # then we cannot approve this meeting to be cancelled
     if ($meeting->getPreviousMeeting() instanceof Meeting && $meeting->getPreviousMeeting()->getIsCancelled() && !$error) {
         header('Location: ' . SITE_URL . 'meetings/cancel/' . $meeting->getID() . '/error');
     }
 }
开发者ID:emilcieslar,项目名称:student-supervisor,代码行数:13,代码来源:meetings.php


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