5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/StatusPreference.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:58684eb3e6d1e474bae8449f4a84ef63)
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.
81 * Is this status check active?
90 public function __construct() {
91 $this->__table
= 'civicrm_status_pref';
92 parent
::__construct();
96 * Returns foreign keys and entity references.
99 * [CRM_Core_Reference_Interface]
101 public static function getReferenceColumns() {
102 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
103 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
104 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
105 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
107 return Civi
::$statics[__CLASS__
]['links'];
111 * Returns all the column names of this table
115 public static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = [
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Status Preference ID'),
122 'description' => ts('Unique Status Preference ID'),
124 'where' => 'civicrm_status_pref.id',
125 'table_name' => 'civicrm_status_pref',
126 'entity' => 'StatusPreference',
127 'bao' => 'CRM_Core_BAO_StatusPreference',
131 'name' => 'domain_id',
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Setting Domain'),
134 'description' => ts('Which Domain is this Status Preference for'),
136 'where' => 'civicrm_status_pref.domain_id',
137 'table_name' => 'civicrm_status_pref',
138 'entity' => 'StatusPreference',
139 'bao' => 'CRM_Core_BAO_StatusPreference',
141 'FKClassName' => 'CRM_Core_DAO_Domain',
142 'pseudoconstant' => [
143 'table' => 'civicrm_domain',
145 'labelColumn' => 'name',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Status Check Name'),
152 'description' => ts('Name of the status check this preference references.'),
155 'size' => CRM_Utils_Type
::HUGE
,
157 'where' => 'civicrm_status_pref.name',
159 'table_name' => 'civicrm_status_pref',
160 'entity' => 'StatusPreference',
161 'bao' => 'CRM_Core_BAO_StatusPreference',
165 'name' => 'hush_until',
166 'type' => CRM_Utils_Type
::T_DATE
,
167 'title' => ts('Snooze Status Notifications Until'),
168 'description' => ts('expires ignore_severity. NULL never hushes.'),
170 'where' => 'civicrm_status_pref.hush_until',
173 'table_name' => 'civicrm_status_pref',
174 'entity' => 'StatusPreference',
175 'bao' => 'CRM_Core_BAO_StatusPreference',
178 'ignore_severity' => [
179 'name' => 'ignore_severity',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Ignore Severity'),
182 'description' => ts('Hush messages up to and including this severity.'),
184 'where' => 'civicrm_status_pref.ignore_severity',
187 'table_name' => 'civicrm_status_pref',
188 'entity' => 'StatusPreference',
189 'bao' => 'CRM_Core_BAO_StatusPreference',
191 'pseudoconstant' => [
192 'callback' => 'CRM_Utils_Check::getSeverityList',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Status Preferences'),
199 'description' => ts('These settings are per-check, and can\'t be compared across checks.'),
201 'size' => CRM_Utils_Type
::HUGE
,
202 'where' => 'civicrm_status_pref.prefs',
203 'table_name' => 'civicrm_status_pref',
204 'entity' => 'StatusPreference',
205 'bao' => 'CRM_Core_BAO_StatusPreference',
209 'name' => 'check_info',
210 'type' => CRM_Utils_Type
::T_STRING
,
211 'title' => ts('Check Info'),
212 'description' => ts('These values are per-check, and can\'t be compared across checks.'),
214 'size' => CRM_Utils_Type
::HUGE
,
215 'where' => 'civicrm_status_pref.check_info',
216 'table_name' => 'civicrm_status_pref',
217 'entity' => 'StatusPreference',
218 'bao' => 'CRM_Core_BAO_StatusPreference',
222 'name' => 'is_active',
223 'type' => CRM_Utils_Type
::T_BOOLEAN
,
224 'title' => ts('Check Is Active'),
225 'description' => ts('Is this status check active?'),
226 'where' => 'civicrm_status_pref.is_active',
228 'table_name' => 'civicrm_status_pref',
229 'entity' => 'StatusPreference',
230 'bao' => 'CRM_Core_BAO_StatusPreference',
234 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
236 return Civi
::$statics[__CLASS__
]['fields'];
240 * Return a mapping from field-name to the corresponding key (as used in fields()).
243 * Array(string $name => string $uniqueName).
245 public static function &fieldKeys() {
246 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
247 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
249 return Civi
::$statics[__CLASS__
]['fieldKeys'];
253 * Returns the names of this table
257 public static function getTableName() {
258 return self
::$_tableName;
262 * Returns if this table needs to be logged
266 public function getLog() {
271 * Returns the list of fields that can be imported
273 * @param bool $prefix
277 public static function &import($prefix = FALSE) {
278 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'status_pref', $prefix, []);
283 * Returns the list of fields that can be exported
285 * @param bool $prefix
289 public static function &export($prefix = FALSE) {
290 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'status_pref', $prefix, []);
295 * Returns the list of indices
297 * @param bool $localize
301 public static function indices($localize = TRUE) {
303 'UI_status_pref_name' => [
304 'name' => 'UI_status_pref_name',
308 'localizable' => FALSE,
309 'sig' => 'civicrm_status_pref::0::name',
312 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;