‪TYPO3CMS  ‪main
InformationStatus.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 
19 
25 {
27 
31  public const ‪STATUS_NOTICE = '';
32 
36  public const ‪STATUS_INFO = 'info';
37 
41  public const ‪STATUS_OK = 'success';
42 
46  public const ‪STATUS_WARNING = 'warning';
47 
51  public const ‪STATUS_ERROR = 'danger';
52 
56  protected static ‪$statusIntegerMap = [
57  self::STATUS_NOTICE => -2,
58  self::STATUS_INFO => -1,
59  self::STATUS_OK => 0,
60  self::STATUS_WARNING => 1,
61  self::STATUS_ERROR => 2,
62  ];
63 
69  public function ‪isGreaterThan(‪InformationStatus $status)
70  {
71  trigger_error(
72  'Calling ' . __METHOD__ . ' using the non-native enumeration ' . __CLASS__ . ' has been deprecated '
73  . 'and will stop working in TYPO3 v14.0. Use the native ' . \‪TYPO3\CMS\Backend\Toolbar\InformationStatus::class . ' instead.',
74  E_USER_DEPRECATED
75  );
76  return self::$statusIntegerMap[(string)$this] > self::$statusIntegerMap[(string)$status];
77  }
78 }
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus\STATUS_INFO
‪const STATUS_INFO
Definition: InformationStatus.php:36
‪TYPO3
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus\isGreaterThan
‪bool isGreaterThan(InformationStatus $status)
Definition: InformationStatus.php:68
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus\STATUS_OK
‪const STATUS_OK
Definition: InformationStatus.php:41
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus\STATUS_WARNING
‪const STATUS_WARNING
Definition: InformationStatus.php:46
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus\STATUS_ERROR
‪const STATUS_ERROR
Definition: InformationStatus.php:51
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus
Definition: InformationStatus.php:25
‪TYPO3\CMS\Backend\Toolbar\Enumeration
Definition: InformationStatus.php:16
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus\__default
‪const __default
Definition: InformationStatus.php:26
‪TYPO3\CMS\Core\Type\Enumeration
Definition: Enumeration.php:31
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus\$statusIntegerMap
‪static int[] $statusIntegerMap
Definition: InformationStatus.php:55
‪TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus\STATUS_NOTICE
‪const STATUS_NOTICE
Definition: InformationStatus.php:31