mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Moving resetCache-method into ChatRoomEditor
This commit is contained in:
parent
d4d748950a
commit
2b6666246b
@ -45,14 +45,6 @@ public static function getCache() {
|
||||
return self::$cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the room cache.
|
||||
*/
|
||||
public static function clearCache() {
|
||||
self::getCache();
|
||||
CacheHandler::getInstance()->clearResource('chatrooms');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\data\chat\room\ChatRoom::getTitle();
|
||||
*/
|
||||
|
@ -10,38 +10,17 @@
|
||||
* @package timwolla.wcf.chat
|
||||
* @subpackage data.chat.room
|
||||
*/
|
||||
class ChatRoomEditor extends \wcf\data\DatabaseObjectEditor {
|
||||
class ChatRoomEditor extends \wcf\data\DatabaseObjectEditor implements \wcf\data\IEditableCachedObject {
|
||||
/**
|
||||
* @see wcf\data\DatabaseObjectDecorator::$baseClass
|
||||
*/
|
||||
protected static $baseClass = '\wcf\data\chat\room\ChatRoom';
|
||||
|
||||
/**
|
||||
* @see wcf\data\IEditableObject::create()
|
||||
* Clears the room cache.
|
||||
*/
|
||||
public static function create(array $parameters = array()) {
|
||||
$room = parent::create($parameters);
|
||||
|
||||
self::clearCache();
|
||||
|
||||
return $room;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see wcf\data\IEditableObject::update()
|
||||
*/
|
||||
public function update(array $parameters = array()) {
|
||||
parent::update($parameters);
|
||||
|
||||
self::clearCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see wcf\data\IEditableObject::update()
|
||||
*/
|
||||
public static function deleteAll(array $objectIDs = array()) {
|
||||
parent::deleteAll($objectIDs);
|
||||
|
||||
self::clearCache();
|
||||
public static function resetCache() {
|
||||
self::getCache();
|
||||
CacheHandler::getInstance()->clearResource('chatrooms');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user