3 namespace wcf\system\user\activity\event;
5 use wcf\data\person\information\PersonInformationList;
6 use wcf\system\SingletonFactory;
10 * User activity event implementation for person information.
12 * @author Matthias Schmidt
13 * @copyright 2001-2021 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @package WoltLabSuite\Core\System\User\Activity\Event
17 class PersonInformationUserActivityEvent extends SingletonFactory implements IUserActivityEvent
22 public function prepare(array $events)
24 $objectIDs = \array_column($events, 'objectID');
26 $informationList = new PersonInformationList();
27 $informationList->setObjectIDs($objectIDs);
28 $informationList->readObjects();
29 $information = $informationList->getObjects();
31 foreach ($events as $event) {
32 if (isset($information[$event->objectID])) {
33 $personInformation = $information[$event->objectID];
35 $event->setIsAccessible();
37 WCF::getLanguage()->getDynamicVariable(
38 'wcf.user.profile.recentActivity.personInformation',
40 'person' => $personInformation->getPerson(),
41 'personInformation' => $personInformation,
45 $event->setDescription($personInformation->getFormattedExcerpt());