Add comment blocks
[civicrm-core.git] / CRM / Core / DAO / StatusPreference.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
10| CiviCRM is free software; you can copy, modify, and distribute it |
11| under the terms of the GNU Affero General Public License |
12| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13| |
14| CiviCRM is distributed in the hope that it will be useful, but |
15| WITHOUT ANY WARRANTY; without even the implied warranty of |
16| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17| See the GNU Affero General Public License for more details. |
18| |
19| You should have received a copy of the GNU Affero General Public |
20| License and the CiviCRM Licensing Exception along |
21| with this program; if not, contact CiviCRM LLC |
22| at info[AT]civicrm[DOT]org. If you have questions about the |
23| GNU Affero General Public License or the licensing of CiviCRM, |
24| see the CiviCRM license FAQ at http://civicrm.org/licensing |
25+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/StatusPreference.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:a4010608f5b37f8e703fd4ae4b63bb35)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Core_DAO_StatusPreference extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_status_pref';
e501603b
TO
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = false;
51 /**
52 * Unique Status Preference ID
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Which Domain is this Status Preference for
59 *
60 * @var int unsigned
61 */
62 public $domain_id;
63 /**
64 * Name of the status check this preference references.
65 *
66 * @var string
67 */
68 public $name;
69 /**
70 * expires ignore_severity. NULL never hushes.
71 *
72 * @var date
73 */
74 public $hush_until;
75 /**
76 * Hush messages up to and including this severity.
77 *
78 * @var int unsigned
79 */
80 public $ignore_severity;
81 /**
82 * These settings are per-check, and can't be compared across checks.
83 *
84 * @var string
85 */
86 public $prefs;
87 /**
88 * These values are per-check, and can't be compared across checks.
89 *
90 * @var string
91 */
92 public $check_info;
93 /**
94 * class constructor
95 *
96 * @return civicrm_status_pref
97 */
98 function __construct() {
99 $this->__table = 'civicrm_status_pref';
100 parent::__construct();
101 }
102 /**
103 * Returns foreign keys and entity references
104 *
105 * @return array
106 * [CRM_Core_Reference_Interface]
107 */
108 static function getReferenceColumns() {
346aaaba
TO
109 if (!isset(Civi::$statics[__CLASS__]['links'])) {
110 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
111 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
112 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 113 }
346aaaba 114 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
115 }
116 /**
117 * Returns all the column names of this table
118 *
119 * @return array
120 */
121 static function &fields() {
346aaaba
TO
122 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
123 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
124 'id' => array(
125 'name' => 'id',
126 'type' => CRM_Utils_Type::T_INT,
127 'title' => ts('Status Preference ID') ,
128 'description' => 'Unique Status Preference ID',
129 'required' => true,
130 ) ,
131 'domain_id' => array(
132 'name' => 'domain_id',
133 'type' => CRM_Utils_Type::T_INT,
134 'title' => ts('Setting Domain') ,
135 'description' => 'Which Domain is this Status Preference for',
136 'required' => true,
137 'FKClassName' => 'CRM_Core_DAO_Domain',
138 'pseudoconstant' => array(
139 'table' => 'civicrm_domain',
140 'keyColumn' => 'id',
141 'labelColumn' => 'name',
142 )
143 ) ,
144 'name' => array(
145 'name' => 'name',
146 'type' => CRM_Utils_Type::T_STRING,
147 'title' => ts('Status Check Name') ,
148 'description' => 'Name of the status check this preference references.',
149 'required' => true,
150 'maxlength' => 255,
151 'size' => CRM_Utils_Type::HUGE,
152 'import' => true,
153 'where' => 'civicrm_status_pref.name',
154 'headerPattern' => '',
155 'dataPattern' => '',
156 'export' => true,
157 ) ,
158 'hush_until' => array(
159 'name' => 'hush_until',
160 'type' => CRM_Utils_Type::T_DATE,
161 'title' => ts('Snooze Status Notifications Until') ,
162 'description' => 'expires ignore_severity. NULL never hushes.',
163 'import' => true,
164 'where' => 'civicrm_status_pref.hush_until',
165 'headerPattern' => '',
166 'dataPattern' => '',
167 'export' => true,
168 'default' => 'NULL',
169 ) ,
170 'ignore_severity' => array(
171 'name' => 'ignore_severity',
172 'type' => CRM_Utils_Type::T_INT,
173 'title' => ts('Ignore Severity') ,
174 'description' => 'Hush messages up to and including this severity.',
175 'import' => true,
176 'where' => 'civicrm_status_pref.ignore_severity',
177 'headerPattern' => '',
178 'dataPattern' => '',
179 'export' => true,
180 'default' => '1',
181 'pseudoconstant' => array(
182 'callback' => 'CRM_Utils_Check::getSeverityList',
183 )
184 ) ,
185 'prefs' => array(
186 'name' => 'prefs',
187 'type' => CRM_Utils_Type::T_STRING,
188 'title' => ts('Status Preferences') ,
189 'description' => 'These settings are per-check, and can\'t be compared across checks.',
190 'maxlength' => 255,
191 'size' => CRM_Utils_Type::HUGE,
192 ) ,
193 'check_info' => array(
194 'name' => 'check_info',
195 'type' => CRM_Utils_Type::T_STRING,
196 'title' => ts('Check Info') ,
197 'description' => 'These values are per-check, and can\'t be compared across checks.',
198 'maxlength' => 255,
199 'size' => CRM_Utils_Type::HUGE,
200 ) ,
201 );
346aaaba 202 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 203 }
346aaaba 204 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
205 }
206 /**
bd8e0b14 207 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
208 *
209 * @return array
bd8e0b14 210 * Array(string $name => string $uniqueName).
e501603b
TO
211 */
212 static function &fieldKeys() {
bd8e0b14
TO
213 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
214 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 215 }
bd8e0b14 216 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
217 }
218 /**
219 * Returns the names of this table
220 *
221 * @return string
222 */
223 static function getTableName() {
224 return self::$_tableName;
225 }
226 /**
227 * Returns if this table needs to be logged
228 *
229 * @return boolean
230 */
231 function getLog() {
232 return self::$_log;
233 }
234 /**
235 * Returns the list of fields that can be imported
236 *
237 * @param bool $prefix
238 *
239 * @return array
240 */
241 static function &import($prefix = false) {
60808919
TO
242 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'status_pref', $prefix, array());
243 return $r;
e501603b
TO
244 }
245 /**
246 * Returns the list of fields that can be exported
247 *
248 * @param bool $prefix
249 *
250 * @return array
251 */
252 static function &export($prefix = false) {
60808919
TO
253 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'status_pref', $prefix, array());
254 return $r;
e501603b
TO
255 }
256}