e72c5a68d038a659bb506129fb2700bda5932b68
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / data / user / UserProfileList.class.php
1 <?php
2
3 namespace wcf\data\user;
4
5 /**
6 * Represents a list of user profiles.
7 *
8 * @author Marcel Werk
9 * @copyright 2001-2019 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\Data\User
12 *
13 * @method UserProfile current()
14 * @method UserProfile[] getObjects()
15 * @method UserProfile|null search($objectID)
16 * @property UserProfile[] $objects
17 */
18 class UserProfileList extends UserList
19 {
20 /**
21 * @inheritDoc
22 */
23 public $sqlOrderBy = 'user_table.username';
24
25 /**
26 * @inheritDoc
27 */
28 public $decoratorClassName = UserProfile::class;
29
30 /**
31 * @inheritDoc
32 */
33 public function __construct()
34 {
35 parent::__construct();
36
37 if (!empty($this->sqlSelects)) {
38 $this->sqlSelects .= ',';
39 }
40 $this->sqlSelects .= "user_avatar.*";
41 $this->sqlJoins .= "
42 LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar
43 ON user_avatar.avatarID = user_table.avatarID";
44
45 if (MODULE_USER_RANK) {
46 $this->sqlSelects .= ",user_rank.*";
47 $this->sqlJoins .= "
48 LEFT JOIN wcf" . WCF_N . "_user_rank user_rank
49 ON user_rank.rankID = user_table.rankID";
50 }
51
52 // get current location
53 $this->sqlSelects .= ", session.pageID, session.pageObjectID, session.lastActivityTime AS sessionLastActivityTime";
54 $this->sqlJoins .= "
55 LEFT JOIN wcf" . WCF_N . "_session session
56 ON session.userID = user_table.userID";
57 }
58
59 /**
60 * @inheritDoc
61 */
62 public function readObjects()
63 {
64 if ($this->objectIDs === null) {
65 $this->readObjectIDs();
66 }
67
68 parent::readObjects();
69 }
70 }