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

Moving resetCache-method into ChatRoomEditor

This commit is contained in:
Tim Düsterhus 2011-12-13 22:18:04 +01:00
parent d4d748950a
commit 2b6666246b
2 changed files with 5 additions and 34 deletions

View File

@ -45,14 +45,6 @@ public static function getCache() {
return self::$cache; return self::$cache;
} }
/**
* Clears the room cache.
*/
public static function clearCache() {
self::getCache();
CacheHandler::getInstance()->clearResource('chatrooms');
}
/** /**
* @see \wcf\data\chat\room\ChatRoom::getTitle(); * @see \wcf\data\chat\room\ChatRoom::getTitle();
*/ */

View File

@ -10,38 +10,17 @@
* @package timwolla.wcf.chat * @package timwolla.wcf.chat
* @subpackage data.chat.room * @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 * @see wcf\data\DatabaseObjectDecorator::$baseClass
*/ */
protected static $baseClass = '\wcf\data\chat\room\ChatRoom'; protected static $baseClass = '\wcf\data\chat\room\ChatRoom';
/** /**
* @see wcf\data\IEditableObject::create() * Clears the room cache.
*/ */
public static function create(array $parameters = array()) { public static function resetCache() {
$room = parent::create($parameters); self::getCache();
CacheHandler::getInstance()->clearResource('chatrooms');
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();
} }
} }