5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/StatusPreference.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:777d59b72a077ecb4d4caa60e13bb479)
13 * Database access object for the StatusPreference entity.
15 class CRM_Core_DAO_StatusPreference
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_status_pref';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
32 * Unique Status Preference ID
39 * Which Domain is this Status Preference for
46 * Name of the status check this preference references.
53 * expires ignore_severity. NULL never hushes.
60 * Hush messages up to and including this severity.
64 public $ignore_severity;
67 * These settings are per-check, and can't be compared across checks.
74 * These values are per-check, and can't be compared across checks.
83 public function __construct() {
84 $this->__table
= 'civicrm_status_pref';
85 parent
::__construct();
89 * Returns foreign keys and entity references.
92 * [CRM_Core_Reference_Interface]
94 public static function getReferenceColumns() {
95 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
96 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
97 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
98 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
100 return Civi
::$statics[__CLASS__
]['links'];
104 * Returns all the column names of this table
108 public static function &fields() {
109 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
110 Civi
::$statics[__CLASS__
]['fields'] = [
113 'type' => CRM_Utils_Type
::T_INT
,
114 'title' => ts('Status Preference ID'),
115 'description' => ts('Unique Status Preference ID'),
117 'where' => 'civicrm_status_pref.id',
118 'table_name' => 'civicrm_status_pref',
119 'entity' => 'StatusPreference',
120 'bao' => 'CRM_Core_BAO_StatusPreference',
124 'name' => 'domain_id',
125 'type' => CRM_Utils_Type
::T_INT
,
126 'title' => ts('Setting Domain'),
127 'description' => ts('Which Domain is this Status Preference for'),
129 'where' => 'civicrm_status_pref.domain_id',
130 'table_name' => 'civicrm_status_pref',
131 'entity' => 'StatusPreference',
132 'bao' => 'CRM_Core_BAO_StatusPreference',
134 'FKClassName' => 'CRM_Core_DAO_Domain',
135 'pseudoconstant' => [
136 'table' => 'civicrm_domain',
138 'labelColumn' => 'name',
143 'type' => CRM_Utils_Type
::T_STRING
,
144 'title' => ts('Status Check Name'),
145 'description' => ts('Name of the status check this preference references.'),
148 'size' => CRM_Utils_Type
::HUGE
,
150 'where' => 'civicrm_status_pref.name',
152 'table_name' => 'civicrm_status_pref',
153 'entity' => 'StatusPreference',
154 'bao' => 'CRM_Core_BAO_StatusPreference',
158 'name' => 'hush_until',
159 'type' => CRM_Utils_Type
::T_DATE
,
160 'title' => ts('Snooze Status Notifications Until'),
161 'description' => ts('expires ignore_severity. NULL never hushes.'),
163 'where' => 'civicrm_status_pref.hush_until',
166 'table_name' => 'civicrm_status_pref',
167 'entity' => 'StatusPreference',
168 'bao' => 'CRM_Core_BAO_StatusPreference',
171 'ignore_severity' => [
172 'name' => 'ignore_severity',
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Ignore Severity'),
175 'description' => ts('Hush messages up to and including this severity.'),
177 'where' => 'civicrm_status_pref.ignore_severity',
180 'table_name' => 'civicrm_status_pref',
181 'entity' => 'StatusPreference',
182 'bao' => 'CRM_Core_BAO_StatusPreference',
184 'pseudoconstant' => [
185 'callback' => 'CRM_Utils_Check::getSeverityList',
190 'type' => CRM_Utils_Type
::T_STRING
,
191 'title' => ts('Status Preferences'),
192 'description' => ts('These settings are per-check, and can\'t be compared across checks.'),
194 'size' => CRM_Utils_Type
::HUGE
,
195 'where' => 'civicrm_status_pref.prefs',
196 'table_name' => 'civicrm_status_pref',
197 'entity' => 'StatusPreference',
198 'bao' => 'CRM_Core_BAO_StatusPreference',
202 'name' => 'check_info',
203 'type' => CRM_Utils_Type
::T_STRING
,
204 'title' => ts('Check Info'),
205 'description' => ts('These values are per-check, and can\'t be compared across checks.'),
207 'size' => CRM_Utils_Type
::HUGE
,
208 'where' => 'civicrm_status_pref.check_info',
209 'table_name' => 'civicrm_status_pref',
210 'entity' => 'StatusPreference',
211 'bao' => 'CRM_Core_BAO_StatusPreference',
215 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
217 return Civi
::$statics[__CLASS__
]['fields'];
221 * Return a mapping from field-name to the corresponding key (as used in fields()).
224 * Array(string $name => string $uniqueName).
226 public static function &fieldKeys() {
227 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
228 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
230 return Civi
::$statics[__CLASS__
]['fieldKeys'];
234 * Returns the names of this table
238 public static function getTableName() {
239 return self
::$_tableName;
243 * Returns if this table needs to be logged
247 public function getLog() {
252 * Returns the list of fields that can be imported
254 * @param bool $prefix
258 public static function &import($prefix = FALSE) {
259 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'status_pref', $prefix, []);
264 * Returns the list of fields that can be exported
266 * @param bool $prefix
270 public static function &export($prefix = FALSE) {
271 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'status_pref', $prefix, []);
276 * Returns the list of indices
278 * @param bool $localize
282 public static function indices($localize = TRUE) {
284 'UI_status_pref_name' => [
285 'name' => 'UI_status_pref_name',
289 'localizable' => FALSE,
290 'sig' => 'civicrm_status_pref::0::name',
293 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;