<?php
namespace wcf\data\event\listener;
use wcf\data\DatabaseObjectEditor;
+use wcf\data\IEditableCachedObject;
+use wcf\system\cache\builder\EventListenerCacheBuilder;
/**
* Provides functions to edit event listener.
* @method EventListener getDecoratedObject()
* @mixin EventListener
*/
-class EventListenerEditor extends DatabaseObjectEditor {
+class EventListenerEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
* @inheritDoc
*/
protected static $baseClass = EventListener::class;
+
+ /**
+ * @inheritDoc
+ * @since 5.2
+ */
+ public static function resetCache() {
+ EventListenerCacheBuilder::getInstance()->reset();
+ }
}
<?php
namespace wcf\data\template\listener;
use wcf\data\DatabaseObjectEditor;
+use wcf\data\IEditableCachedObject;
+use wcf\system\cache\builder\TemplateListenerCodeCacheBuilder;
+use wcf\system\language\LanguageFactory;
/**
* Provides functions to edit template listeners.
* @method TemplateListener getDecoratedObject()
* @mixin TemplateListener
*/
-class TemplateListenerEditor extends DatabaseObjectEditor {
+class TemplateListenerEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
* @inheritDoc
*/
protected static $baseClass = TemplateListener::class;
+
+ /**
+ * @inheritDoc
+ * @since 5.2
+ */
+ public static function resetCache() {
+ TemplateListenerCodeCacheBuilder::getInstance()->reset();
+
+ // delete compiled templates
+ LanguageFactory::getInstance()->deleteLanguageCache();
+ }
}