1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Changing CacheBuilder to return the list rather than an array

Furthermore if the parameter is not passend we will select the first room automatically
This commit is contained in:
Tim Düsterhus 2011-11-26 17:49:35 +01:00
parent 8ee9b0a207
commit aba9a07a3c
2 changed files with 4 additions and 8 deletions

View File

@ -36,12 +36,9 @@ public function assignVariables() {
public function readData() {
parent::readData();
$this->rooms = chat\room\ChatRoom::getCache();
if (isset($this->rooms[$this->roomID])) {
$this->room = $this->rooms[$this->roomID];
}
else {
throw new \wcf\system\exception\IllegalLinkException();
}
$this->room = $this->rooms->search($this->roomID);
if (!$this->room) throw new \wcf\system\exception\IllegalLinkException();
}
/**

View File

@ -20,8 +20,7 @@ public function getData(array $cacheResource) {
$roomList->sqlOrderBy = "chat_room.position";
$roomList->sqlLimit = 0;
$roomList->readObjects();
$rooms = $roomList->getObjects();
return $rooms;
return $roomList;
}
}