db0e4b86d568c9cfc2fd174e09ed679a715cd698
[Packages/TYPO3.CMS.git] / typo3 / sysext / reports / reports / status / class.tx_reports_reports_status_status.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009-2010 Ingo Renner <ingo@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25
26 /**
27 * A class representing a certain status
28 *
29 * @author Ingo Renner <ingo@typo3.org>
30 * @package TYPO3
31 * @subpackage reports
32 *
33 * $Id$
34 */
35 class tx_reports_reports_status_Status {
36
37 const NOTICE = -2;
38 const INFO = -1;
39 const OK = 0;
40 const WARNING = 1;
41 const ERROR = 2;
42
43 protected $title;
44 protected $value;
45 protected $message;
46 protected $severity;
47
48 /**
49 * constructor for class tx_reports_report_status_Status
50 *
51 * @param string the status' title
52 * @param string the status' value
53 * @param string an optional message further describing the status
54 * @param integer a severity level, one of
55 */
56 public function __construct($title, $value, $message = '', $severity = self::OK) {
57 $this->title = (string) $title;
58 $this->value = (string) $value;
59 $this->message = (string) $message;
60
61 $this->severity = t3lib_div::intInRange(
62 $severity,
63 self::NOTICE, self::ERROR, self::OK
64 );
65 }
66
67 /**
68 * gets the status' title
69 *
70 * @return string
71 */
72 public function getTitle() {
73 return $this->title;
74 }
75
76 /**
77 * gets the status' value
78 *
79 * @return string
80 */
81 public function getValue() {
82 return $this->value;
83 }
84
85 /**
86 * gets the status' message (if any)
87 *
88 * @return string
89 */
90 public function getMessage() {
91 return $this->message;
92 }
93
94 /**
95 * gets the status' severity
96 *
97 * @return integer
98 */
99 public function getSeverity() {
100 return $this->severity;
101 }
102 }
103
104
105 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_status.php'])) {
106 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_status.php']);
107 }
108
109 ?>