2 namespace wcf\system\user\notification\object\type;
3 use wcf\data\object\type\AbstractObjectTypeProcessor;
4 use wcf\data\DatabaseObjectList;
7 * Provides a default implementation of IUserNotificationObjectType.
10 * @copyright 2001-2016 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package com.woltlab.wcf
13 * @subpackage system.user.notification.object.type
14 * @category Community Framework
16 class AbstractUserNotificationObjectType extends AbstractObjectTypeProcessor implements IUserNotificationObjectType {
18 * class name of the object decorator
21 protected static $decoratorClassName = '';
27 protected static $objectClassName = '';
30 * class name for DatabaseObjectList
33 protected static $objectListClassName = '';
38 public function getObjectsByIDs(array $objectIDs) {
39 $indexName = call_user_func([static::$objectClassName, 'getDatabaseTableIndexName']);
41 /** @var DatabaseObjectList $objectList */
42 $objectList = new static::$objectListClassName();
43 $objectList->setObjectIDs($objectIDs);
44 $objectList->sqlLimit = 0;
45 $objectList->decoratorClassName = static::$decoratorClassName;
46 $objectList->readObjects();
47 $objects = $objectList->getObjects();
49 foreach ($objectIDs as $objectID) {
50 // append empty objects for unknown ids
51 if (!isset($objects[$objectID])) {
52 // '__unknownNotificationObject' tells the notification API
53 // that the object does not exist anymore so that the related
54 // notification can be deleted automatically
55 $objects[$objectID] = new static::$decoratorClassName(new static::$objectClassName(null, [
56 '__unknownNotificationObject' => true,
57 $indexName => $objectID