5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/StatusPreference.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6a9e433b487d14f9b8e036f8491e6a9c)
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 static $_tableName = 'civicrm_status_pref';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Unique Status Preference ID',
117 'table_name' => 'civicrm_status_pref',
118 'entity' => 'StatusPreference',
119 'bao' => 'CRM_Core_BAO_StatusPreference',
123 'name' => 'domain_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Setting Domain'),
126 'description' => 'Which Domain is this Status Preference for',
128 'table_name' => 'civicrm_status_pref',
129 'entity' => 'StatusPreference',
130 'bao' => 'CRM_Core_BAO_StatusPreference',
132 'FKClassName' => 'CRM_Core_DAO_Domain',
133 'pseudoconstant' => [
134 'table' => 'civicrm_domain',
136 'labelColumn' => 'name',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('Status Check Name'),
143 'description' => 'Name of the status check this preference references.',
146 'size' => CRM_Utils_Type
::HUGE
,
148 'where' => 'civicrm_status_pref.name',
149 'headerPattern' => '',
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' => 'expires ignore_severity. NULL never hushes.',
163 'where' => 'civicrm_status_pref.hush_until',
164 'headerPattern' => '',
168 'table_name' => 'civicrm_status_pref',
169 'entity' => 'StatusPreference',
170 'bao' => 'CRM_Core_BAO_StatusPreference',
173 'ignore_severity' => [
174 'name' => 'ignore_severity',
175 'type' => CRM_Utils_Type
::T_INT
,
176 'title' => ts('Ignore Severity'),
177 'description' => 'Hush messages up to and including this severity.',
179 'where' => 'civicrm_status_pref.ignore_severity',
180 'headerPattern' => '',
184 'table_name' => 'civicrm_status_pref',
185 'entity' => 'StatusPreference',
186 'bao' => 'CRM_Core_BAO_StatusPreference',
188 'pseudoconstant' => [
189 'callback' => 'CRM_Utils_Check::getSeverityList',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Status Preferences'),
196 'description' => 'These settings are per-check, and can\'t be compared across checks.',
198 'size' => CRM_Utils_Type
::HUGE
,
199 'table_name' => 'civicrm_status_pref',
200 'entity' => 'StatusPreference',
201 'bao' => 'CRM_Core_BAO_StatusPreference',
205 'name' => 'check_info',
206 'type' => CRM_Utils_Type
::T_STRING
,
207 'title' => ts('Check Info'),
208 'description' => 'These values are per-check, and can\'t be compared across checks.',
210 'size' => CRM_Utils_Type
::HUGE
,
211 'table_name' => 'civicrm_status_pref',
212 'entity' => 'StatusPreference',
213 'bao' => 'CRM_Core_BAO_StatusPreference',
217 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
219 return Civi
::$statics[__CLASS__
]['fields'];
223 * Return a mapping from field-name to the corresponding key (as used in fields()).
226 * Array(string $name => string $uniqueName).
228 public static function &fieldKeys() {
229 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
230 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
232 return Civi
::$statics[__CLASS__
]['fieldKeys'];
236 * Returns the names of this table
240 public static function getTableName() {
241 return self
::$_tableName;
245 * Returns if this table needs to be logged
249 public function getLog() {
254 * Returns the list of fields that can be imported
256 * @param bool $prefix
260 public static function &import($prefix = FALSE) {
261 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'status_pref', $prefix, []);
266 * Returns the list of fields that can be exported
268 * @param bool $prefix
272 public static function &export($prefix = FALSE) {
273 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'status_pref', $prefix, []);
278 * Returns the list of indices
280 * @param bool $localize
284 public static function indices($localize = TRUE) {
286 'UI_status_pref_name' => [
287 'name' => 'UI_status_pref_name',
291 'localizable' => FALSE,
292 'sig' => 'civicrm_status_pref::0::name',
295 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;