Add `@method` comment for `DatabaseObjectList::getSingleObject()` in subclasses
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / data / comment / ViewableCommentList.class.php
1 <?php
2
3 namespace wcf\data\comment;
4
5 use wcf\system\cache\runtime\UserProfileRuntimeCache;
6
7 /**
8 * Represents a list of decorated comment objects.
9 *
10 * @author Marcel Werk
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
14 *
15 * @method ViewableComment current()
16 * @method ViewableComment[] getObjects()
17 * @method ViewableComment|null getSingleObject()
18 * @method ViewableComment|null seach($objectID)
19 * @property ViewableComment[] $objects
20 */
21 class ViewableCommentList extends CommentList
22 {
23 /**
24 * @inheritDoc
25 */
26 public $decoratorClassName = ViewableComment::class;
27
28 /**
29 * @inheritDoc
30 */
31 public function readObjects()
32 {
33 parent::readObjects();
34
35 if (!empty($this->objects)) {
36 $userIDs = [];
37 foreach ($this->objects as $comment) {
38 if ($comment->userID) {
39 $userIDs[] = $comment->userID;
40 }
41 }
42
43 if (!empty($userIDs)) {
44 UserProfileRuntimeCache::getInstance()->cacheObjectIDs($userIDs);
45 }
46 }
47 }
48 }