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


PHP Room::setAbbrev方法代码示例

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


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

示例1: 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);
     }
 }
开发者ID:artkuo,项目名称:ocs,代码行数:27,代码来源:RoomForm.inc.php

示例2: 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;
 }
开发者ID:artkuo,项目名称:ocs,代码行数:52,代码来源:Upgrade.inc.php


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