‪TYPO3CMS  ‪main
Status.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 
16 namespace ‪TYPO3\CMS\Reports;
17 
19 
23 class ‪Status
24 {
28  protected ‪$title;
29 
33  protected ‪$value;
34 
38  protected ‪$message;
39 
41 
54  public function ‪__construct(‪$title, ‪$value, ‪$message = '', ‪ContextualFeedbackSeverity ‪$severity = ContextualFeedbackSeverity::OK)
55  {
56  $this->title = (string)‪$title;
57  $this->value = (string)‪$value;
58  $this->message = (string)‪$message;
59  $this->severity = ‪$severity;
60  }
61 
67  public function ‪getTitle()
68  {
69  return ‪$this->title;
70  }
71 
77  public function ‪getValue()
78  {
79  return ‪$this->value;
80  }
81 
87  public function ‪getMessage()
88  {
90  }
91 
93  {
94  return ‪$this->severity;
95  }
96 
102  public function ‪__toString()
103  {
104  // Max length 80 characters
105  $stringRepresentation = str_pad('[' . $this->severity->name . ']', 7) . str_pad($this->title, 40) . ' - ' . substr($this->value, 0, 30);
106  return $stringRepresentation;
107  }
108 }
‪TYPO3\CMS\Reports\Status\getSeverity
‪getSeverity()
Definition: Status.php:89
‪TYPO3\CMS\Reports\Status\$severity
‪ContextualFeedbackSeverity $severity
Definition: Status.php:37
‪TYPO3\CMS\Reports\Status\getMessage
‪string getMessage()
Definition: Status.php:84
‪TYPO3\CMS\Core\Type\ContextualFeedbackSeverity
‪ContextualFeedbackSeverity
Definition: ContextualFeedbackSeverity.php:25
‪TYPO3\CMS\Reports\Status
Definition: Status.php:24
‪TYPO3\CMS\Reports
‪TYPO3\CMS\Reports\Status\__toString
‪string __toString()
Definition: Status.php:99
‪TYPO3\CMS\Reports\Status\getValue
‪string getValue()
Definition: Status.php:74
‪TYPO3\CMS\Reports\Status\$title
‪string $title
Definition: Status.php:27
‪TYPO3\CMS\Reports\Status\$value
‪string $value
Definition: Status.php:31
‪TYPO3\CMS\Reports\Status\__construct
‪__construct($title, $value, $message='', ContextualFeedbackSeverity $severity=ContextualFeedbackSeverity::OK)
Definition: Status.php:51
‪TYPO3\CMS\Reports\Status\getTitle
‪string getTitle()
Definition: Status.php:64
‪TYPO3\CMS\Reports\Status\$message
‪string $message
Definition: Status.php:35