mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10: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:
parent
8ee9b0a207
commit
aba9a07a3c
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user