3 namespace wcf\data\comment
;
5 use wcf\system\cache\runtime\UserProfileRuntimeCache
;
8 * Represents a list of decorated comment objects.
11 * @copyright 2001-2019 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package WoltLabSuite\Core\Data\Comment
15 * @method ViewableComment current()
16 * @method ViewableComment[] getObjects()
17 * @method ViewableComment|null getSingleObject()
18 * @method ViewableComment|null seach($objectID)
19 * @property ViewableComment[] $objects
21 class ViewableCommentList
extends CommentList
26 public $decoratorClassName = ViewableComment
::class;
31 public function readObjects()
33 parent
::readObjects();
35 if (!empty($this->objects
)) {
37 foreach ($this->objects
as $comment) {
38 if ($comment->userID
) {
39 $userIDs[] = $comment->userID
;
43 if (!empty($userIDs)) {
44 UserProfileRuntimeCache
::getInstance()->cacheObjectIDs($userIDs);