CRM-20312 add field localisation data to DAO.
[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
022785d8 33 * (GenCodeChecksum:1499bd12f161a041bdb9ccfd2595cd94)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_StatusPreference constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_StatusPreference extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_status_pref';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Unique Status Preference ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Which Domain is this Status Preference for
61 *
62 * @var int unsigned
63 */
64 public $domain_id;
65 /**
66 * Name of the status check this preference references.
67 *
68 * @var string
69 */
70 public $name;
71 /**
72 * expires ignore_severity. NULL never hushes.
73 *
74 * @var date
75 */
76 public $hush_until;
77 /**
78 * Hush messages up to and including this severity.
79 *
80 * @var int unsigned
81 */
82 public $ignore_severity;
83 /**
84 * These settings are per-check, and can't be compared across checks.
85 *
86 * @var string
87 */
88 public $prefs;
89 /**
90 * These values are per-check, and can't be compared across checks.
91 *
92 * @var string
93 */
94 public $check_info;
95 /**
f41f0342 96 * Class constructor.
e501603b
TO
97 */
98 function __construct() {
99 $this->__table = 'civicrm_status_pref';
100 parent::__construct();
101 }
102 /**
f41f0342 103 * Returns foreign keys and entity references.
e501603b
TO
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,
522a26c9 130 'table_name' => 'civicrm_status_pref',
131 'entity' => 'StatusPreference',
132 'bao' => 'CRM_Core_BAO_StatusPreference',
e501603b
TO
133 ) ,
134 'domain_id' => array(
135 'name' => 'domain_id',
136 'type' => CRM_Utils_Type::T_INT,
137 'title' => ts('Setting Domain') ,
138 'description' => 'Which Domain is this Status Preference for',
139 'required' => true,
522a26c9 140 'table_name' => 'civicrm_status_pref',
141 'entity' => 'StatusPreference',
142 'bao' => 'CRM_Core_BAO_StatusPreference',
e501603b
TO
143 'FKClassName' => 'CRM_Core_DAO_Domain',
144 'pseudoconstant' => array(
145 'table' => 'civicrm_domain',
146 'keyColumn' => 'id',
147 'labelColumn' => 'name',
148 )
149 ) ,
150 'name' => array(
151 'name' => 'name',
152 'type' => CRM_Utils_Type::T_STRING,
153 'title' => ts('Status Check Name') ,
154 'description' => 'Name of the status check this preference references.',
155 'required' => true,
156 'maxlength' => 255,
157 'size' => CRM_Utils_Type::HUGE,
158 'import' => true,
159 'where' => 'civicrm_status_pref.name',
160 'headerPattern' => '',
161 'dataPattern' => '',
162 'export' => true,
522a26c9 163 'table_name' => 'civicrm_status_pref',
164 'entity' => 'StatusPreference',
165 'bao' => 'CRM_Core_BAO_StatusPreference',
e501603b
TO
166 ) ,
167 'hush_until' => array(
168 'name' => 'hush_until',
169 'type' => CRM_Utils_Type::T_DATE,
170 'title' => ts('Snooze Status Notifications Until') ,
171 'description' => 'expires ignore_severity. NULL never hushes.',
172 'import' => true,
173 'where' => 'civicrm_status_pref.hush_until',
174 'headerPattern' => '',
175 'dataPattern' => '',
176 'export' => true,
177 'default' => 'NULL',
522a26c9 178 'table_name' => 'civicrm_status_pref',
179 'entity' => 'StatusPreference',
180 'bao' => 'CRM_Core_BAO_StatusPreference',
e501603b
TO
181 ) ,
182 'ignore_severity' => array(
183 'name' => 'ignore_severity',
184 'type' => CRM_Utils_Type::T_INT,
185 'title' => ts('Ignore Severity') ,
186 'description' => 'Hush messages up to and including this severity.',
187 'import' => true,
188 'where' => 'civicrm_status_pref.ignore_severity',
189 'headerPattern' => '',
190 'dataPattern' => '',
191 'export' => true,
192 'default' => '1',
522a26c9 193 'table_name' => 'civicrm_status_pref',
194 'entity' => 'StatusPreference',
195 'bao' => 'CRM_Core_BAO_StatusPreference',
e501603b
TO
196 'pseudoconstant' => array(
197 'callback' => 'CRM_Utils_Check::getSeverityList',
198 )
199 ) ,
200 'prefs' => array(
201 'name' => 'prefs',
202 'type' => CRM_Utils_Type::T_STRING,
203 'title' => ts('Status Preferences') ,
204 'description' => 'These settings are per-check, and can\'t be compared across checks.',
205 'maxlength' => 255,
206 'size' => CRM_Utils_Type::HUGE,
522a26c9 207 'table_name' => 'civicrm_status_pref',
208 'entity' => 'StatusPreference',
209 'bao' => 'CRM_Core_BAO_StatusPreference',
e501603b
TO
210 ) ,
211 'check_info' => array(
212 'name' => 'check_info',
213 'type' => CRM_Utils_Type::T_STRING,
214 'title' => ts('Check Info') ,
215 'description' => 'These values are per-check, and can\'t be compared across checks.',
216 'maxlength' => 255,
217 'size' => CRM_Utils_Type::HUGE,
522a26c9 218 'table_name' => 'civicrm_status_pref',
219 'entity' => 'StatusPreference',
220 'bao' => 'CRM_Core_BAO_StatusPreference',
e501603b
TO
221 ) ,
222 );
346aaaba 223 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 224 }
346aaaba 225 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
226 }
227 /**
bd8e0b14 228 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
229 *
230 * @return array
bd8e0b14 231 * Array(string $name => string $uniqueName).
e501603b
TO
232 */
233 static function &fieldKeys() {
bd8e0b14
TO
234 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
235 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 236 }
bd8e0b14 237 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
238 }
239 /**
240 * Returns the names of this table
241 *
242 * @return string
243 */
244 static function getTableName() {
245 return self::$_tableName;
246 }
247 /**
248 * Returns if this table needs to be logged
249 *
250 * @return boolean
251 */
252 function getLog() {
253 return self::$_log;
254 }
255 /**
256 * Returns the list of fields that can be imported
257 *
258 * @param bool $prefix
259 *
260 * @return array
261 */
262 static function &import($prefix = false) {
60808919
TO
263 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'status_pref', $prefix, array());
264 return $r;
e501603b
TO
265 }
266 /**
267 * Returns the list of fields that can be exported
268 *
269 * @param bool $prefix
270 *
271 * @return array
272 */
273 static function &export($prefix = false) {
60808919
TO
274 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'status_pref', $prefix, array());
275 return $r;
e501603b
TO
276 }
277}