-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathDevtoolsMissingLanguageItem.class.php
More file actions
55 lines (49 loc) · 1.75 KB
/
DevtoolsMissingLanguageItem.class.php
File metadata and controls
55 lines (49 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace wcf\data\devtools\missing\language\item;
use wcf\data\DatabaseObject;
use wcf\data\language\Language;
use wcf\system\language\LanguageFactory;
use wcf\system\WCF;
/**
* Represents a missing language item log entry.
*
* @author Matthias Schmidt
* @copyright 2001-2020 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 5.3
*
* @property-read int $itemID unique id of the missing language item log entry
* @property-read ?int $languageID id of the language the missing language item was requested for
* @property-read string $languageItem name of the missing language item
* @property-read int $lastTime timestamp of the last time the missing language item was requested
* @property-read string $stackTrace stack trace of how the missing language item was requested for the last time
*/
class DevtoolsMissingLanguageItem extends DatabaseObject
{
/**
* Returns the language the missing language item was requested for or `null` if the language
* does not exist anymore.
*
* @return null|Language
*/
public function getLanguage()
{
if ($this->languageID === null) {
return null;
}
return LanguageFactory::getInstance()->getLanguage($this->languageID);
}
/**
* Returns the formatted stack trace of how the missing language item was requested for the
* last time.
*
* @return string
*/
public function getStackTrace()
{
$stackTrace = \json_decode($this->stackTrace, true, flags: \JSON_THROW_ON_ERROR);
return WCF::getTPL()->render('wcf', '__devtoolsMissingLanguageItemStackTrace', [
'stackTrace' => $stackTrace,
]);
}
}