‪TYPO3CMS  11.5
LogEntry.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
28 {
29  use ‪LogDataTrait;
30 
36  protected ‪$pid = 0;
37 
45  protected int ‪$backendUserUid = 0;
46 
50  protected int ‪$action = 0;
51 
55  protected int ‪$recordUid = 0;
56 
60  protected string ‪$tableName = '';
61 
65  protected int ‪$recordPid = 0;
66 
70  protected int ‪$error = 0;
71 
75  protected string ‪$details = '';
76 
80  protected int ‪$tstamp = 0;
81 
85  protected int ‪$type = 0;
86 
90  protected string ‪$channel = 'narf';
91 
95  protected string ‪$level = '';
96 
100  protected int ‪$detailsNumber = 0;
101 
105  protected string ‪$ip = '';
106 
110  protected string ‪$logData = '';
111 
115  protected int ‪$eventPid = 0;
116 
120  protected int ‪$workspaceUid = 0;
121 
128  protected ‪$newId = 0;
129 
135  public function ‪setBackendUserUid($beUserUid)
136  {
137  $this->backendUserUid = $beUserUid;
138  }
139 
145  public function ‪getBackendUserUid()
146  {
148  }
149 
155  public function ‪setAction(‪$action)
156  {
157  $this->action = ‪$action;
158  }
159 
165  public function ‪getAction()
166  {
167  return (int)‪$this->action;
168  }
169 
175  public function ‪setRecordUid(‪$recordUid)
176  {
177  $this->recordUid = ‪$recordUid;
178  }
179 
185  public function ‪getRecordUid()
186  {
187  return (int)‪$this->recordUid;
188  }
189 
195  public function ‪setTableName(‪$tableName)
196  {
197  $this->tableName = ‪$tableName;
198  }
199 
205  public function ‪getTableName()
206  {
207  return ‪$this->tableName;
208  }
209 
215  public function ‪setRecordPid(‪$recordPid)
216  {
217  $this->recordPid = ‪$recordPid;
218  }
219 
225  public function ‪getRecordPid()
226  {
227  return (int)‪$this->recordPid;
228  }
229 
235  public function ‪setError(‪$error)
236  {
237  $this->error = ‪$error;
238  }
239 
245  public function ‪getError()
246  {
247  return (int)‪$this->error;
248  }
249 
255  public function ‪getErrorIconClass(): string
256  {
257  switch ($this->‪getError()) {
258  case 1:
259  return 'status-dialog-warning';
260  case 2:
261  case 3:
262  return 'status-dialog-error';
263  default:
264  return 'empty-empty';
265  }
266  }
267 
273  public function ‪setDetails($details)
274  {
275  $this->details = ‪$details;
276  }
277 
283  public function ‪getDetails()
284  {
285  if ($this->type === 255) {
286  return str_replace('###IP###', $this->ip, $this->details);
287  }
288  return ‪$this->details;
289  }
290 
296  public function ‪setTstamp(‪$tstamp)
297  {
298  $this->tstamp = ‪$tstamp;
299  }
300 
306  public function ‪getTstamp()
307  {
308  return (int)‪$this->tstamp;
309  }
310 
316  public function ‪setType(‪$type)
317  {
318  $this->type = ‪$type;
319  }
320 
326  public function ‪getType()
327  {
328  return (int)‪$this->type;
329  }
330 
334  public function ‪setChannel(string ‪$channel): void
335  {
336  $this->channel = ‪$channel;
337  }
338 
342  public function ‪getChannel(): string
343  {
344  return ‪$this->channel;
345  }
346 
350  public function ‪setLevel(string ‪$level): void
351  {
352  $this->level = ‪$level;
353  }
354 
358  public function ‪getLevel(): string
359  {
360  return ‪$this->level;
361  }
362 
368  public function ‪setDetailsNumber(‪$detailsNumber)
369  {
370  $this->detailsNumber = ‪$detailsNumber;
371  }
372 
378  public function ‪getDetailsNumber()
379  {
380  return (int)‪$this->detailsNumber;
381  }
382 
388  public function ‪setIp(‪$ip)
389  {
390  $this->ip = ‪$ip;
391  }
392 
398  public function ‪getIp()
399  {
400  return ‪$this->ip;
401  }
402 
408  public function ‪setLogData(‪$logData)
409  {
410  $this->logData = ‪$logData;
411  }
412 
418  public function ‪getLogData()
419  {
420  if ($this->logData === '') {
421  return [];
422  }
423  ‪$logData = $this->‪unserializeLogData($this->logData);
424  return ‪$logData ?? [];
425  }
426 
432  public function ‪setEventPid(‪$eventPid)
433  {
434  $this->eventPid = ‪$eventPid;
435  }
436 
442  public function ‪getEventPid()
443  {
444  return (int)‪$this->eventPid;
445  }
446 
452  public function ‪setWorkspaceUid(‪$workspaceUid)
453  {
454  $this->workspaceUid = ‪$workspaceUid;
455  }
456 
462  public function ‪getWorkspaceUid()
463  {
464  return (int)‪$this->workspaceUid;
465  }
466 
472  public function ‪setNewId(‪$newId)
473  {
474  $this->newId = ‪$newId;
475  }
476 
482  public function ‪getNewId()
483  {
484  return ‪$this->newId;
485  }
486 }
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$workspaceUid
‪int $workspaceUid
Definition: LogEntry.php:118
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setType
‪setType($type)
Definition: LogEntry.php:313
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setRecordPid
‪setRecordPid($recordPid)
Definition: LogEntry.php:212
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getRecordUid
‪int getRecordUid()
Definition: LogEntry.php:182
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getType
‪int getType()
Definition: LogEntry.php:323
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getEventPid
‪int getEventPid()
Definition: LogEntry.php:439
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$detailsNumber
‪int $detailsNumber
Definition: LogEntry.php:98
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$backendUserUid
‪int $backendUserUid
Definition: LogEntry.php:43
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setAction
‪setAction($action)
Definition: LogEntry.php:152
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getError
‪int getError()
Definition: LogEntry.php:242
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setTableName
‪setTableName($tableName)
Definition: LogEntry.php:192
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getBackendUserUid
‪int getBackendUserUid()
Definition: LogEntry.php:142
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setEventPid
‪setEventPid($eventPid)
Definition: LogEntry.php:429
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$action
‪int $action
Definition: LogEntry.php:48
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setBackendUserUid
‪setBackendUserUid($beUserUid)
Definition: LogEntry.php:132
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$recordPid
‪int $recordPid
Definition: LogEntry.php:63
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$ip
‪string $ip
Definition: LogEntry.php:103
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setLevel
‪setLevel(string $level)
Definition: LogEntry.php:347
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$logData
‪string $logData
Definition: LogEntry.php:108
‪TYPO3\CMS\Extbase\DomainObject\AbstractEntity
Definition: AbstractEntity.php:22
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getRecordPid
‪int getRecordPid()
Definition: LogEntry.php:222
‪TYPO3\CMS\Core\Log\LogDataTrait\unserializeLogData
‪array null unserializeLogData($logData)
Definition: LogDataTrait.php:33
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$level
‪string $level
Definition: LogEntry.php:93
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$type
‪int $type
Definition: LogEntry.php:83
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setNewId
‪setNewId($newId)
Definition: LogEntry.php:469
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getLogData
‪array getLogData()
Definition: LogEntry.php:415
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setDetails
‪setDetails($details)
Definition: LogEntry.php:270
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$eventPid
‪int $eventPid
Definition: LogEntry.php:113
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setLogData
‪setLogData($logData)
Definition: LogEntry.php:405
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$newId
‪string $newId
Definition: LogEntry.php:125
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getDetails
‪string getDetails()
Definition: LogEntry.php:280
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$tableName
‪string $tableName
Definition: LogEntry.php:58
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getErrorIconClass
‪string getErrorIconClass()
Definition: LogEntry.php:252
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setDetailsNumber
‪setDetailsNumber($detailsNumber)
Definition: LogEntry.php:365
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getTstamp
‪int getTstamp()
Definition: LogEntry.php:303
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getWorkspaceUid
‪int getWorkspaceUid()
Definition: LogEntry.php:459
‪TYPO3\CMS\Belog\Domain\Model\LogEntry
Definition: LogEntry.php:28
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$recordUid
‪int $recordUid
Definition: LogEntry.php:53
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getAction
‪int getAction()
Definition: LogEntry.php:162
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setRecordUid
‪setRecordUid($recordUid)
Definition: LogEntry.php:172
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setTstamp
‪setTstamp($tstamp)
Definition: LogEntry.php:293
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$tstamp
‪int $tstamp
Definition: LogEntry.php:78
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$error
‪int $error
Definition: LogEntry.php:68
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setChannel
‪setChannel(string $channel)
Definition: LogEntry.php:331
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setError
‪setError($error)
Definition: LogEntry.php:232
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getLevel
‪getLevel()
Definition: LogEntry.php:355
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getChannel
‪getChannel()
Definition: LogEntry.php:339
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$details
‪string $details
Definition: LogEntry.php:73
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$pid
‪int $pid
Definition: LogEntry.php:34
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setIp
‪setIp($ip)
Definition: LogEntry.php:385
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getTableName
‪string getTableName()
Definition: LogEntry.php:202
‪TYPO3\CMS\Belog\Domain\Model
Definition: Constraint.php:16
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getIp
‪string getIp()
Definition: LogEntry.php:395
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\$channel
‪string $channel
Definition: LogEntry.php:88
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getNewId
‪string int getNewId()
Definition: LogEntry.php:479
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\setWorkspaceUid
‪setWorkspaceUid($workspaceUid)
Definition: LogEntry.php:449
‪TYPO3\CMS\Core\Log\LogDataTrait
Definition: LogDataTrait.php:25
‪TYPO3\CMS\Belog\Domain\Model\LogEntry\getDetailsNumber
‪int getDetailsNumber()
Definition: LogEntry.php:375