Added tag REL_8.08.07 for changeset 787bc13eaaae11105549b3f87a05b2a63f0cba52
[iserv-mod-error-reporter.git] / inc / class_erErrorReport.inc
1 <?php
2 /**
3 * @file class_erErrorReport.inc
4 * A container class for an error report
5 * @author Roland Hieber (roland.hieber@wilhelm-gym.net)
6 * @date 18.10.2007
7 *
8 * Copyright © 2007 Roland Hieber
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
16 *
17 * The above copyright notice and this permission notice shall be included in
18 * all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 * THE SOFTWARE.
27 */
28
29 /** This class represents a dataset stored in the SQL table */
30 class erErrorReport {
31
32 /**
33 * @privatesection
34 * (int) Unique ID in the database
35 */
36 var $nUid;
37 /** (timestamp) Date when the report was created */
38 var $tsDate;
39 /** (string) Account name of the owner */
40 var $strOwner;
41 /** (string) Machine to which the report refers */
42 var $strMachine;
43 /** (string) Text of the report */
44 var $strText;
45 /** (string) Comments of an administrator */
46 var $strComment;
47 /** (string) Account name of the one who wrote the comment */
48 var $strCommentOwner;
49 /** (bool) Indicate if the report can be seen by non-administrators */
50 var $bHidden;
51
52 /**
53 * @publicsection
54 * @name Constructor
55 * @{
56 */
57 /**
58 * Constructor. Used to set the data.
59 * @param $tsDate (timestamp) Date when the report was created
60 * @param $strOwner (string) Account name of the creator
61 * @param $strMachine (string) Machine to which the report refers
62 * @param $strText (string) Text of the report
63 * @param $bHidden (bool) Indicate if the report can be seen by non-administrators
64 * @return erError
65 */
66 function erErrorReport($tsDate = null, $strOwner = null, $strMachine = null, $strText = null,
67 $bHidden = false) {
68 $this->nUid = null;
69 $this->tsDate = intval($tsDate);
70 $this->strOwner = $strOwner;
71 $this->strMachine = $strMachine;
72 $this->strText = $strText;
73 $this->strComment = null;
74 $this->strCommentOwner = null;
75 $this->bHidden = ($bHidden == true);
76 }
77
78 /////////////////////////////////////////// SETTER FUNCTIONS ///////////////////////////////////////////
79
80 /**
81 * @}
82 * @name Setter functions
83 * @{
84 */
85
86 /**
87 * Set the unique ID
88 * @param $value (int)
89 */
90 function setUid($value) { $this->nUid = $value; }
91 /**
92 * Set the date
93 * @param $value (timestamp)
94 */
95 function setDate($value) { $this->tsDate = intval($value); }
96 /**
97 * Set the account name of the owner
98 * @param $value (string)
99 */
100 function setOwner($value) { $this->strOwner = $value; }
101 /**
102 * Set the label of the machine to which the report refers
103 * @param $value (string)
104 */
105 function setMachine($value) { $this->strMachine = $value; }
106 /**
107 * Set the text of the report
108 * @param $value (string)
109 */
110 function setText($value) { $this->strText = $value; }
111
112 /**
113 * Set the comment of an adminstrator
114 * @param $strComment (string) Comment
115 * @param $strAct (string) Account name of the person who sets the comment
116 */
117 function setComment($strComment, $strAct) {
118 $this->strComment = $strComment;
119 $this->strCommentOwner = $strAct;
120 }
121 /**
122 * Set the visibility of the report
123 * @param $value (bool) <tt>true</tt>: the report is only visible for administrators
124 */
125 function setVisibility($value) { $this->bHidden = $value; }
126
127 /////////////////////////////////////////// GETTER FUNCTIONS ///////////////////////////////////////////
128
129 /**
130 * @}
131 * @name Getter functions
132 * @{
133 */
134
135 /**
136 * Get the unique ID in the database
137 * @return (int)
138 */
139 function getUid() { return intval($this->nUid); }
140 /**
141 * Get the date when the report was created
142 * @return (timestamp)
143 */
144 function getDate() { return intval($this->tsDate); }
145 /**
146 * Get the account name of the creator
147 * @return (string)
148 */
149 function getOwner() { return $this->strOwner; }
150 /**
151 * Get the label of the machine to which the report refers
152 * @return (string)
153 */
154 function getMachine() { return $this->strMachine; }
155 /**
156 * Get the tet of the report
157 * @return (string)
158 */
159 function getText() { return $this->strText; }
160 /**
161 * Get the comment from an administrator
162 * @return (string)
163 */
164 function getComment() { return $this->strComment; }
165 /**
166 * Get the account name of the one who wrote the comment
167 * @return (string)
168 */
169 function getCommentOwner() { return $this->strCommentOwner; }
170 /**
171 * Determine if the report can be seen by non-administrators
172 * @return (bool)
173 */
174 function isHidden() { return ($this->bHidden == true); }
175
176 /**@}*/
177 }
178 ?>
This page took 0.05285 seconds and 5 git commands to generate.