From: Matthias Schmidt Date: Sun, 24 Jul 2011 09:25:30 +0000 (+0200) Subject: Moved to new cache builder folder X-Git-Tag: 2.0.0_Beta_1~1971^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8e0f4ddb6dfcbec61100aafbd4d80d8178a14c54;p=GitHub%2FWoltLab%2FWCF.git Moved to new cache builder folder Moved CacheBuilderUserNotificationObjectType to the cache builder folder, updated the namespace and used the namespace of ICacheBuilder. --- diff --git a/com.woltlab.wcf.notification/files/lib/system/cache/CacheBuilderUserNotificationObjectType.class.php b/com.woltlab.wcf.notification/files/lib/system/cache/CacheBuilderUserNotificationObjectType.class.php deleted file mode 100644 index 2a7950ccda..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/cache/CacheBuilderUserNotificationObjectType.class.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.cache - * @category Community Framework - */ -class CacheBuilderUserNotificationObjectType implements ICacheBuilder { - /** - * @see wcf\system\cache\ICacheBuilder::getData() - */ - public function getData($cacheResource) { - $data = array(); - - // get package id - $tmp = explode('-', $cacheResource['cache']); - $packageID = array_pop($tmp); - - // get object types - $typeIDArray = array(); - $sql = "SELECT object_type.* - FROM wcf".WCF_N."_user_notification_object_type object_type, - wcf".WCF_N."_package_dependency package_dependency - WHERE object_type.packageID = package_dependency.dependency - AND package_dependency.packageID = ? - ORDER BY package_dependency.priority DESC"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array($packageID)); - while ($row = $statement->fetchArray()) { - if (!isset($data[$row['objectType']])) { - $databaseObject = new UserNotificationObjectType(null, $row); - $data[$row['objectType']] = array( - 'object' => $databaseObject->getProcessor(), - 'events' => array() - ); - } - } - - // get events - $sql = "SELECT event.*, object_type.objectType - FROM wcf".WCF_N."_package_dependency package_dependency, - wcf".WCF_N."_user_notification_event event - LEFT JOIN wcf".WCF_N."_user_notification_object_type object_type - ON (object_type.objectTypeID = event.objectTypeID) - WHERE event.packageID = package_dependency.dependency - AND package_dependency.packageID = ? - ORDER BY package_dependency.priority DESC"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array($packageID)); - while ($row = $statement->fetchArray()) { - if (isset($data[$row['objectType']]) && !isset($data[$row['objectType']]['events'][$row['eventName']])) { - $databaseObject = new UserNotificationEvent(null, $row); - $data[$row['objectType']]['events'][$row['eventName']] = $databaseObject->getProcessor(); - } - } - - return $data; - } -} diff --git a/com.woltlab.wcf.notification/files/lib/system/cache/builder/CacheBuilderUserNotificationObjectType.class.php b/com.woltlab.wcf.notification/files/lib/system/cache/builder/CacheBuilderUserNotificationObjectType.class.php new file mode 100644 index 0000000000..3d8dcd7107 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/system/cache/builder/CacheBuilderUserNotificationObjectType.class.php @@ -0,0 +1,69 @@ + + * @package com.woltlab.wcf.notification + * @subpackage system.cache + * @category Community Framework + */ +class CacheBuilderUserNotificationObjectType implements ICacheBuilder { + /** + * @see wcf\system\cache\ICacheBuilder::getData() + */ + public function getData($cacheResource) { + $data = array(); + + // get package id + $tmp = explode('-', $cacheResource['cache']); + $packageID = array_pop($tmp); + + // get object types + $typeIDArray = array(); + $sql = "SELECT object_type.* + FROM wcf".WCF_N."_user_notification_object_type object_type, + wcf".WCF_N."_package_dependency package_dependency + WHERE object_type.packageID = package_dependency.dependency + AND package_dependency.packageID = ? + ORDER BY package_dependency.priority DESC"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array($packageID)); + while ($row = $statement->fetchArray()) { + if (!isset($data[$row['objectType']])) { + $databaseObject = new UserNotificationObjectType(null, $row); + $data[$row['objectType']] = array( + 'object' => $databaseObject->getProcessor(), + 'events' => array() + ); + } + } + + // get events + $sql = "SELECT event.*, object_type.objectType + FROM wcf".WCF_N."_package_dependency package_dependency, + wcf".WCF_N."_user_notification_event event + LEFT JOIN wcf".WCF_N."_user_notification_object_type object_type + ON (object_type.objectTypeID = event.objectTypeID) + WHERE event.packageID = package_dependency.dependency + AND package_dependency.packageID = ? + ORDER BY package_dependency.priority DESC"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array($packageID)); + while ($row = $statement->fetchArray()) { + if (isset($data[$row['objectType']]) && !isset($data[$row['objectType']]['events'][$row['eventName']])) { + $databaseObject = new UserNotificationEvent(null, $row); + $data[$row['objectType']]['events'][$row['eventName']] = $databaseObject->getProcessor(); + } + } + + return $data; + } +}