4bd48d544777d5aa17cbb0b8b5b32bbcb193fd36
[GitHub/WoltLab/WCF.git] /
1 <?php
2 namespace wcf\system\message\embedded\object;
3 use wcf\data\user\UserList;
4 use wcf\system\cache\runtime\UserProfileRuntimeCache;
5
6 /**
7 * IMessageEmbeddedObjectHandler implementation for quotes.
8 *
9 * @author Marcel Werk
10 * @copyright 2001-2016 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package WoltLabSuite\Core\System\Message\Embedded\Object
13 */
14 class QuoteMessageEmbeddedObjectHandler extends AbstractMessageEmbeddedObjectHandler {
15 /**
16 * @inheritDoc
17 */
18 public function parseMessage($message) {
19 $usernames = self::getFirstParameters($message, 'quote');
20 if (!empty($usernames)) {
21 $userList = new UserList();
22 $userList->getConditionBuilder()->add("user_table.username IN (?)", [$usernames]);
23 $userList->readObjectIDs();
24 return $userList->getObjectIDs();
25 }
26
27 return false;
28 }
29
30 /**
31 * @inheritDoc
32 */
33 public function loadObjects(array $objectIDs) {
34 return UserProfileRuntimeCache::getInstance()->getObjects($objectIDs);
35 }
36 }