本文整理汇总了PHP中Room::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Room::getId方法的具体用法?PHP Room::getId怎么用?PHP Room::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room::getId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setRoom
/**
* Declares an association between this object and a Room object.
*
* @param Room $v
* @return RoomHasFeaturevalue The current object (for fluent API support)
* @throws PropelException
*/
public function setRoom(Room $v = null)
{
if ($v === null) {
$this->setRoomId(NULL);
} else {
$this->setRoomId($v->getId());
}
$this->aRoom = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Room object, it will not be re-added.
if ($v !== null) {
$v->addRoomHasFeaturevalue($this);
}
return $this;
}
示例2: addInstanceToPool
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param Room $value A Room object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(Room $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
self::$instances[$key] = $obj;
}
}
示例3: 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);
}
}
示例4: processTopicForm
/**
*
* @param sfWebRequest $request
* @param sfForm $form
* @param Room $room
* @return <bool> false if preview action
*/
protected function processTopicForm(sfWebRequest $request, sfForm $form, Room $room, User $user)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid()) {
if ($this->getRequestParameter('submitAct')) {
$values = $form->getValues();
// topic saving
$topic = new Topic();
$topic->setTitle($values['title']);
$topic->setIdRoom($room->getId());
$topic->setIdUser($user->getId());
$topic->save();
// post saving
$post = new Post();
$post->setContent($values['post']['content']);
$post->setIdTopic($topic->getId());
$post->setIdUser($user->getId());
$post->save();
$this->redirect('room_topic_show', $topic);
} else {
if ($this->getRequestParameter('prevSubmitAct')) {
return;
} else {
return false;
}
}
}
}
示例5: processCopyForm
protected function processCopyForm(sfWebRequest $request, sfForm $form, Room $room)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid()) {
$this->forward404Unless($copyRoom = RoomPeer::retrieveByPk($form->getValue('copyRoom_id')), sprintf('Object room does not exist (%s).', $form->getValue('copyRoom_id')));
if ($copyRoom->getId() != $room->getId()) {
$room->copyDayperiodsFromRoom($copyRoom);
$room->save();
}
$this->redirect('dayperiod/index?roomId=' . $room->getId());
}
}
示例6: copyDayperiodsFromRoom
public function copyDayperiodsFromRoom(Room $room)
{
if ($room->getId() == $this->getId()) {
return;
}
$this->clearDayperiods();
$dayperiods = $room->getDayperiods();
foreach ($dayperiods as $dayperiod) {
$newDayperiod = $dayperiod->copyWithoutRoom();
$this->addDayperiod($newDayperiod);
}
}