Fix typo in method documentation
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / data / media / ViewableMediaList.class.php
1 <?php
2
3 namespace wcf\data\media;
4
5 use wcf\system\WCF;
6
7 /**
8 * Represents a list of viewable media files.
9 *
10 * @author Matthias Schmidt
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\Media
14 * @since 3.0
15 *
16 * @method ViewableMedia current()
17 * @method ViewableMedia[] getObjects()
18 * @method ViewableMedia|null getSingleObject()
19 * @method ViewableMedia|null search($objectID)
20 * @property ViewableMedia[] $objects
21 */
22 class ViewableMediaList extends MediaList
23 {
24 /**
25 * @inheritDoc
26 */
27 public $decoratorClassName = ViewableMedia::class;
28
29 /**
30 * Creates a new ViewableMediaList object.
31 *
32 * @param int|null $languageID
33 */
34 public function __construct($languageID = null)
35 {
36 parent::__construct();
37
38 if ($languageID === null) {
39 $languageID = WCF::getLanguage()->languageID;
40 }
41
42 // fetch content data
43 $this->sqlSelects .= "media_content.*, COALESCE(media.languageID, " . $languageID . ") AS localizedLanguageID";
44 $this->sqlJoins .= "
45 LEFT JOIN wcf" . WCF_N . "_media_content media_content
46 ON media_content.mediaID = media.mediaID
47 AND media_content.languageID = COALESCE(media.languageID, " . $languageID . ")";
48 }
49 }