3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2016
31 * Generated from xml/schema/CRM/Core/StatusPreference.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:a4010608f5b37f8e703fd4ae4b63bb35)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_StatusPreference
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_status_pref';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
84 * Unique Status Preference ID
90 * Which Domain is this Status Preference for
96 * Name of the status check this preference references.
102 * expires ignore_severity. NULL never hushes.
108 * Hush messages up to and including this severity.
112 public $ignore_severity;
114 * These settings are per-check, and can't be compared across checks.
120 * These values are per-check, and can't be compared across checks.
128 * @return civicrm_status_pref
130 function __construct() {
131 $this->__table
= 'civicrm_status_pref';
132 parent
::__construct();
135 * Returns foreign keys and entity references
138 * [CRM_Core_Reference_Interface]
140 static function getReferenceColumns() {
141 if (!self
::$_links) {
142 self
::$_links = static ::createReferenceColumns(__CLASS__
);
143 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
145 return self
::$_links;
148 * Returns all the column names of this table
152 static function &fields() {
153 if (!(self
::$_fields)) {
154 self
::$_fields = array(
157 'type' => CRM_Utils_Type
::T_INT
,
158 'title' => ts('Status Preference ID') ,
159 'description' => 'Unique Status Preference ID',
162 'domain_id' => array(
163 'name' => 'domain_id',
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Setting Domain') ,
166 'description' => 'Which Domain is this Status Preference for',
168 'FKClassName' => 'CRM_Core_DAO_Domain',
169 'pseudoconstant' => array(
170 'table' => 'civicrm_domain',
172 'labelColumn' => 'name',
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Status Check Name') ,
179 'description' => 'Name of the status check this preference references.',
182 'size' => CRM_Utils_Type
::HUGE
,
184 'where' => 'civicrm_status_pref.name',
185 'headerPattern' => '',
189 'hush_until' => array(
190 'name' => 'hush_until',
191 'type' => CRM_Utils_Type
::T_DATE
,
192 'title' => ts('Snooze Status Notifications Until') ,
193 'description' => 'expires ignore_severity. NULL never hushes.',
195 'where' => 'civicrm_status_pref.hush_until',
196 'headerPattern' => '',
201 'ignore_severity' => array(
202 'name' => 'ignore_severity',
203 'type' => CRM_Utils_Type
::T_INT
,
204 'title' => ts('Ignore Severity') ,
205 'description' => 'Hush messages up to and including this severity.',
207 'where' => 'civicrm_status_pref.ignore_severity',
208 'headerPattern' => '',
212 'pseudoconstant' => array(
213 'callback' => 'CRM_Utils_Check::getSeverityList',
218 'type' => CRM_Utils_Type
::T_STRING
,
219 'title' => ts('Status Preferences') ,
220 'description' => 'These settings are per-check, and can\'t be compared across checks.',
222 'size' => CRM_Utils_Type
::HUGE
,
224 'check_info' => array(
225 'name' => 'check_info',
226 'type' => CRM_Utils_Type
::T_STRING
,
227 'title' => ts('Check Info') ,
228 'description' => 'These values are per-check, and can\'t be compared across checks.',
230 'size' => CRM_Utils_Type
::HUGE
,
234 return self
::$_fields;
237 * Returns an array containing, for each field, the arary key used for that
238 * field in self::$_fields.
242 static function &fieldKeys() {
243 if (!(self
::$_fieldKeys)) {
244 self
::$_fieldKeys = array(
246 'domain_id' => 'domain_id',
248 'hush_until' => 'hush_until',
249 'ignore_severity' => 'ignore_severity',
251 'check_info' => 'check_info',
254 return self
::$_fieldKeys;
257 * Returns the names of this table
261 static function getTableName() {
262 return self
::$_tableName;
265 * Returns if this table needs to be logged
273 * Returns the list of fields that can be imported
275 * @param bool $prefix
279 static function &import($prefix = false) {
280 if (!(self
::$_import)) {
281 self
::$_import = array();
282 $fields = self
::fields();
283 foreach($fields as $name => $field) {
284 if (CRM_Utils_Array
::value('import', $field)) {
286 self
::$_import['status_pref'] = & $fields[$name];
288 self
::$_import[$name] = & $fields[$name];
293 return self
::$_import;
296 * Returns the list of fields that can be exported
298 * @param bool $prefix
302 static function &export($prefix = false) {
303 if (!(self
::$_export)) {
304 self
::$_export = array();
305 $fields = self
::fields();
306 foreach($fields as $name => $field) {
307 if (CRM_Utils_Array
::value('export', $field)) {
309 self
::$_export['status_pref'] = & $fields[$name];
311 self
::$_export[$name] = & $fields[$name];
316 return self
::$_export;