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:
parent
8ee9b0a207
commit
aba9a07a3c
@ -36,12 +36,9 @@ public function assignVariables() {
|
|||||||
public function readData() {
|
public function readData() {
|
||||||
parent::readData();
|
parent::readData();
|
||||||
$this->rooms = chat\room\ChatRoom::getCache();
|
$this->rooms = chat\room\ChatRoom::getCache();
|
||||||
if (isset($this->rooms[$this->roomID])) {
|
$this->room = $this->rooms->search($this->roomID);
|
||||||
$this->room = $this->rooms[$this->roomID];
|
|
||||||
}
|
if (!$this->room) throw new \wcf\system\exception\IllegalLinkException();
|
||||||
else {
|
|
||||||
throw new \wcf\system\exception\IllegalLinkException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,8 +20,7 @@ public function getData(array $cacheResource) {
|
|||||||
$roomList->sqlOrderBy = "chat_room.position";
|
$roomList->sqlOrderBy = "chat_room.position";
|
||||||
$roomList->sqlLimit = 0;
|
$roomList->sqlLimit = 0;
|
||||||
$roomList->readObjects();
|
$roomList->readObjects();
|
||||||
$rooms = $roomList->getObjects();
|
|
||||||
|
|
||||||
return $rooms;
|
return $roomList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user