本文整理汇总了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;
}
示例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');
}
}