本文整理汇总了PHP中Room::setBuildingId方法的典型用法代码示例。如果您正苦于以下问题:PHP Room::setBuildingId方法的具体用法?PHP Room::setBuildingId怎么用?PHP Room::setBuildingId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room::setBuildingId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Room
/**
* Internal function to return a Room object from a row.
* @param $row array
* @return Room
*/
function &_returnRoomFromRow(&$row)
{
$room = new Room();
$room->setId($row['room_id']);
$room->setBuildingId($row['building_id']);
$this->getDataObjectSettings('room_settings', 'room_id', $row['room_id'], $room);
return $room;
}
示例2: execute
/**
* Save room.
*/
function execute()
{
$roomDao = DAORegistry::getDAO('RoomDAO');
$schedConf =& Request::getSchedConf();
if (isset($this->roomId)) {
$room =& $roomDao->getRoom($this->roomId);
}
if (!isset($room)) {
$room = new Room();
}
$room->setBuildingId($this->buildingId);
$room->setName($this->getData('name'), null);
// Localized
$room->setAbbrev($this->getData('abbrev'), null);
// Localized
$room->setDescription($this->getData('description'), null);
// Localized
// Update or insert room
if ($room->getId() != null) {
$roomDao->updateRoom($room);
} else {
$roomDao->insertRoom($room);
}
}
示例3: migratePaperLocations
/**
* For upgrade to 2.1.0: Migrate paper locations into scheduler
* @return boolean
*/
function migratePaperLocations()
{
$paperDao = DAORegistry::getDAO('PaperDAO');
$buildingDao = DAORegistry::getDAO('BuildingDAO');
$roomDao = DAORegistry::getDAO('RoomDAO');
$lastSchedConfId = null;
$buildingId = null;
$result =& $paperDao->retrieve("SELECT p.paper_id, c.primary_locale, sc.sched_conf_id, p.location FROM papers p, published_papers pp, sched_confs sc, conferences c WHERE p.paper_id = pp.paper_id AND p.sched_conf_id = sc.sched_conf_id AND sc.conference_id = c.conference_id AND location IS NOT NULL AND location <> '' ORDER BY sched_conf_id");
while (!$result->EOF) {
$row = $result->GetRowAssoc(false);
$paperId = $row['paper_id'];
$schedConfId = $row['sched_conf_id'];
$locale = $row['primary_locale'];
$location = $row['location'];
if ($schedConfId !== $lastSchedConfId) {
// Create a default building
$defaultText = __('common.default');
$building = new Building();
$building->setSchedConfId($schedConfId);
$building->setName($defaultText, $locale);
$building->setAbbrev($defaultText, $locale);
$building->setDescription($defaultText, $locale);
$buildingId = $buildingDao->insertBuilding($building);
unset($building);
$rooms = array();
}
if (!isset($rooms[$location])) {
$room = new Room();
$room->setBuildingId($buildingId);
$room->setName($location, $locale);
$room->setAbbrev($location, $locale);
$room->setDescription($location, $locale);
$roomId = $roomDao->insertRoom($room);
$rooms[$location] =& $room;
unset($room);
} else {
$room =& $rooms[$location];
$roomId = $room->getId();
unset($room);
}
$paperDao->update('UPDATE published_papers SET room_id = ? WHERE paper_id = ?', array($roomId, $paperId));
$result->MoveNext();
$lastSchedConfId = $schedConfId;
}
$result->Close();
unset($result);
return true;
}