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:48ca8492c6febf737281831d72147a38)
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 localized title of this entity.
98 public static function getEntityTitle() {
99 return ts('Status Preferences');
103 * Returns foreign keys and entity references.
106 * [CRM_Core_Reference_Interface]
108 public static function getReferenceColumns() {
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']);
114 return Civi
::$statics[__CLASS__
]['links'];
118 * Returns all the column names of this table
122 public static function &fields() {
123 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
124 Civi
::$statics[__CLASS__
]['fields'] = [
127 'type' => CRM_Utils_Type
::T_INT
,
128 'title' => ts('Status Preference ID'),
129 'description' => ts('Unique Status Preference ID'),
131 'where' => 'civicrm_status_pref.id',
132 'table_name' => 'civicrm_status_pref',
133 'entity' => 'StatusPreference',
134 'bao' => 'CRM_Core_BAO_StatusPreference',
139 'name' => 'domain_id',
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Setting Domain'),
142 'description' => ts('Which Domain is this Status Preference for'),
144 'where' => 'civicrm_status_pref.domain_id',
145 'table_name' => 'civicrm_status_pref',
146 'entity' => 'StatusPreference',
147 'bao' => 'CRM_Core_BAO_StatusPreference',
149 'FKClassName' => 'CRM_Core_DAO_Domain',
150 'pseudoconstant' => [
151 'table' => 'civicrm_domain',
153 'labelColumn' => 'name',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Status Check Name'),
161 'description' => ts('Name of the status check this preference references.'),
164 'size' => CRM_Utils_Type
::HUGE
,
166 'where' => 'civicrm_status_pref.name',
168 'table_name' => 'civicrm_status_pref',
169 'entity' => 'StatusPreference',
170 'bao' => 'CRM_Core_BAO_StatusPreference',
175 'name' => 'hush_until',
176 'type' => CRM_Utils_Type
::T_DATE
,
177 'title' => ts('Snooze Status Notifications Until'),
178 'description' => ts('expires ignore_severity. NULL never hushes.'),
180 'where' => 'civicrm_status_pref.hush_until',
183 'table_name' => 'civicrm_status_pref',
184 'entity' => 'StatusPreference',
185 'bao' => 'CRM_Core_BAO_StatusPreference',
189 'ignore_severity' => [
190 'name' => 'ignore_severity',
191 'type' => CRM_Utils_Type
::T_INT
,
192 'title' => ts('Ignore Severity'),
193 'description' => ts('Hush messages up to and including this severity.'),
195 'where' => 'civicrm_status_pref.ignore_severity',
198 'table_name' => 'civicrm_status_pref',
199 'entity' => 'StatusPreference',
200 'bao' => 'CRM_Core_BAO_StatusPreference',
202 'pseudoconstant' => [
203 'callback' => 'CRM_Utils_Check::getSeverityList',
209 'type' => CRM_Utils_Type
::T_STRING
,
210 'title' => ts('Status Preferences'),
211 'description' => ts('These settings are per-check, and can\'t be compared across checks.'),
213 'size' => CRM_Utils_Type
::HUGE
,
214 'where' => 'civicrm_status_pref.prefs',
215 'table_name' => 'civicrm_status_pref',
216 'entity' => 'StatusPreference',
217 'bao' => 'CRM_Core_BAO_StatusPreference',
222 'name' => 'check_info',
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('Check Info'),
225 'description' => ts('These values are per-check, and can\'t be compared across checks.'),
227 'size' => CRM_Utils_Type
::HUGE
,
228 'where' => 'civicrm_status_pref.check_info',
229 'table_name' => 'civicrm_status_pref',
230 'entity' => 'StatusPreference',
231 'bao' => 'CRM_Core_BAO_StatusPreference',
236 'name' => 'is_active',
237 'type' => CRM_Utils_Type
::T_BOOLEAN
,
238 'title' => ts('Check Is Active'),
239 'description' => ts('Is this status check active?'),
240 'where' => 'civicrm_status_pref.is_active',
242 'table_name' => 'civicrm_status_pref',
243 'entity' => 'StatusPreference',
244 'bao' => 'CRM_Core_BAO_StatusPreference',
249 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
251 return Civi
::$statics[__CLASS__
]['fields'];
255 * Return a mapping from field-name to the corresponding key (as used in fields()).
258 * Array(string $name => string $uniqueName).
260 public static function &fieldKeys() {
261 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
262 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
264 return Civi
::$statics[__CLASS__
]['fieldKeys'];
268 * Returns the names of this table
272 public static function getTableName() {
273 return self
::$_tableName;
277 * Returns if this table needs to be logged
281 public function getLog() {
286 * Returns the list of fields that can be imported
288 * @param bool $prefix
292 public static function &import($prefix = FALSE) {
293 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'status_pref', $prefix, []);
298 * Returns the list of fields that can be exported
300 * @param bool $prefix
304 public static function &export($prefix = FALSE) {
305 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'status_pref', $prefix, []);
310 * Returns the list of indices
312 * @param bool $localize
316 public static function indices($localize = TRUE) {
318 'UI_status_pref_name' => [
319 'name' => 'UI_status_pref_name',
323 'localizable' => FALSE,
324 'sig' => 'civicrm_status_pref::0::name',
327 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;