3 namespace wcf\data\devtools\missing\language\item
;
5 use wcf\data\DatabaseObject
;
6 use wcf\data\language\Language
;
7 use wcf\system\language\LanguageFactory
;
12 * Represents a missing language item log entry.
14 * @author Matthias Schmidt
15 * @copyright 2001-2020 WoltLab GmbH
16 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
17 * @package WoltLabSuite\Core\Devtools\Missing\Language\Item
20 * @property-read int $itemID unique id of the missing language item log entry
21 * @property-read int $languageID id of the language the missing language item was requested for
22 * @property-read string $languageItem name of the missing language item
23 * @property-read int $lastTime timestamp of the last time the missing language item was requested
24 * @property-read string $stackTrace stack trace of how the missing language item was requested for the last time
26 class DevtoolsMissingLanguageItem
extends DatabaseObject
29 * Returns the language the missing language item was requested for or `null` if the language
30 * does not exist anymore.
32 * @return null|Language
34 public function getLanguage()
36 if ($this->languageID
=== null) {
40 return LanguageFactory
::getInstance()->getLanguage($this->languageID
);
44 * Returns the formatted stack trace of how the missing language item was requested for the
49 public function getStackTrace()
51 $stackTrace = JSON
::decode($this->stackTrace
);
52 foreach ($stackTrace as &$stackEntry) {
53 foreach ($stackEntry['args'] as &$stackEntryArg) {
54 if (\
gettype($stackEntryArg) === 'string') {
55 $stackEntryArg = \
str_replace(["\n", "\t"], ['\n', '\t'], $stackEntryArg);
58 unset($stackEntryArg);
62 return WCF
::getTPL()->fetch('__devtoolsMissingLanguageItemStackTrace', 'wcf', [
63 'stackTrace' => $stackTrace,