本文整理汇总了PHP中History::setDate方法的典型用法代码示例。如果您正苦于以下问题:PHP History::setDate方法的具体用法?PHP History::setDate怎么用?PHP History::setDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History::setDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
//.........这里部分代码省略.........
$resultRoom = $this->dao->saveNewRoom($roomPlataform);
$roomPlataform = $this->dao->getRoomByCourse($roomCourse);
// Set manager permission of room
$permission = new Permission();
$permission->setUserId($managerId);
$permission->setRoomId($roomPlataform->getRoomId());
$resultPermission = $this->dao->savePermission($permission);
}
// Checks permissions
$permissions = $this->dao->listPermissions($roomPlataform->getRoomId());
$havePermission = false;
foreach ($permissions as $permission) {
if ($permission->getUserId() == $user->getUserId()) {
$havePermission = true;
}
}
if (!$havePermission) {
$permission = new Permission();
$permission->setUserId($user->getUserId());
$permission->setRoomId($roomPlataform->getRoomId());
$resultPermission = $this->dao->savePermission($permission);
}
$roomPlataform = $this->dao->getRoomByCourse($roomCourse);
$_SESSION['plataform'] = true;
unset($_POST["group"]);
unset($_POST['manager']);
unset($_POST["name"]);
unset($_POST["email"]);
// If the room is active, will be given a join
if ($roomPlataform->getActive() == 1) {
$_SESSION["idRoom"] = $roomPlataform->getRoomId();
$room = $this->dao->getRoom($roomPlataform->getRoomId());
// put the production in the session
$idProduction = $room->getActiveProduction();
$_SESSION['idProduction'] = $idProduction;
$history = new History();
$history->setUserId($_SESSION["id"]);
$history->setProductionId($idProduction);
$history->setDate(date('Y-m-d'));
$resultHistory = $this->dao->saveHistory($history);
// Retrieving the users in the room
$_REQUEST["users"] = $this->dao->getRoomUsers($_SESSION['idProduction']);
// Showing the page
$this->pageController->run($forwards['success']);
} else {
if ($user->getUserId() == $roomPlataform->getUserId()) {
// If it is not active and the user is the owner of the room, will be given a start in the room
$production = new Production();
$production->setCreationDate(date('Y-m-d'));
$production->setUpdateDate(date('Y-m-d'));
$production->setRoomId($roomPlataform->getRoomId());
$resultProduction = $this->dao->createProduction($production);
if ($resultProduction) {
$_SESSION['idProduction'] = $production->getProductionId();
}
$resultUpdateRoom = $this->dao->updateRoomState($roomPlataform->getRoomId(), true, $_SESSION['idProduction']);
if ($resultUpdateRoom) {
$_SESSION["idRoom"] = $roomPlataform->getRoomId();
}
$resultRoom = $this->dao->getRoom($roomPlataform->getRoomId());
if ($resultRoom) {
$_SESSION["currentRoomManager"] = $resultRoom->getUserId();
}
$history = new History();
$history->setUserId($_SESSION["id"]);
$history->setProductionId($_SESSION['idProduction']);
$history->setDate(date('Y-m-d'));
$resultHistory = $this->dao->saveHistory($history);
// Retrieving the users in the room
$_REQUEST["users"] = $this->dao->getRoomUsers($_SESSION['idProduction']);
$this->pageController->run($forwards['success']);
} else {
// Otherwise, the room is closed and the user must wait until she opens
unset($_SESSION['id']);
unset($_SESSION['name']);
unset($_SESSION['roomCreator']);
unset($_SESSION['email']);
unset($_SESSION['user']);
// Closed room
echo "<script type='text/javascript'>";
echo "alert('" . $msgs->getText('error.plataform.closeRoom') . "');";
// Without permission echo "history.go(-{$numReturnPages});";
echo "</script>";
}
}
} else {
// Without permission
echo "<script type='text/javascript'>";
echo "alert('" . $msgs->getText('error.plataform.withoutPermission') . "');";
echo "history.go(-{$numReturnPages});";
echo "</script>";
}
} else {
// Insufficient data
echo "<script type='text/javascript'>";
echo "alert('" . $msgs->getText('error.plataform.insufficientData') . "');";
echo "history.go(-{$numReturnPages});";
echo "</script>";
}
}
示例2: execute
public function execute($action)
{
$forwards = $action->getForwards();
$_SESSION["idRoom"] = $_GET["idRoom"];
$room = $this->dao->getRoom($_GET["idRoom"]);
if ($room) {
// If the room is open
if ($room->getActive() != 0) {
// put the production in the session
$idProduction = $room->getActiveProduction();
$_SESSION['idProduction'] = $idProduction;
$history = new History();
$history->setUserId($_SESSION["id"]);
$history->setProductionId($idProduction);
$history->setDate(date('Y-m-d'));
$resultHistory = $this->dao->saveHistory($history);
// Retrieving the users in the room
$_REQUEST["users"] = $this->dao->getRoomUsers($_SESSION['idProduction']);
// Showing the page
$this->pageController->run($forwards['success']);
} else {
$_REQUEST["errorMsg"] = $this->message->getText("error.closeRoom");
$this->pageController->run($forwards['error']);
}
} else {
$_REQUEST["errorMsg"] = $this->message->getText("error.retrieveRoom");
$this->pageController->run($forwards['error']);
}
}