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:ec99239ddba33ac2d8a514b5e94b0b24)
13 * Database access object for the StatusPreference entity.
15 class CRM_Core_DAO_StatusPreference
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.7';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_status_pref';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
34 * Unique Status Preference ID
41 * Which Domain is this Status Preference for
48 * Name of the status check this preference references.
55 * expires ignore_severity. NULL never hushes.
62 * Hush messages up to and including this severity.
66 public $ignore_severity;
69 * These settings are per-check, and can't be compared across checks.
76 * These values are per-check, and can't be compared across checks.
83 * Is this status check active?
92 public function __construct() {
93 $this->__table
= 'civicrm_status_pref';
94 parent
::__construct();
98 * Returns localized title of this entity.
100 * @param bool $plural
101 * Whether to return the plural version of the title.
103 public static function getEntityTitle($plural = FALSE) {
104 return $plural ?
ts('Status Preferences') : ts('Status Preference');
108 * Returns foreign keys and entity references.
111 * [CRM_Core_Reference_Interface]
113 public static function getReferenceColumns() {
114 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
115 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
116 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
117 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
119 return Civi
::$statics[__CLASS__
]['links'];
123 * Returns all the column names of this table
127 public static function &fields() {
128 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
129 Civi
::$statics[__CLASS__
]['fields'] = [
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Status Preference ID'),
134 'description' => ts('Unique Status Preference ID'),
136 'where' => 'civicrm_status_pref.id',
137 'table_name' => 'civicrm_status_pref',
138 'entity' => 'StatusPreference',
139 'bao' => 'CRM_Core_BAO_StatusPreference',
147 'name' => 'domain_id',
148 'type' => CRM_Utils_Type
::T_INT
,
149 'title' => ts('Domain ID'),
150 'description' => ts('Which Domain is this Status Preference for'),
152 'where' => 'civicrm_status_pref.domain_id',
153 'table_name' => 'civicrm_status_pref',
154 'entity' => 'StatusPreference',
155 'bao' => 'CRM_Core_BAO_StatusPreference',
157 'FKClassName' => 'CRM_Core_DAO_Domain',
159 'label' => ts("Domain"),
161 'pseudoconstant' => [
162 'table' => 'civicrm_domain',
164 'labelColumn' => 'name',
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('Status Check Name'),
172 'description' => ts('Name of the status check this preference references.'),
175 'size' => CRM_Utils_Type
::HUGE
,
177 'where' => 'civicrm_status_pref.name',
179 'table_name' => 'civicrm_status_pref',
180 'entity' => 'StatusPreference',
181 'bao' => 'CRM_Core_BAO_StatusPreference',
186 'name' => 'hush_until',
187 'type' => CRM_Utils_Type
::T_DATE
,
188 'title' => ts('Snooze Status Notifications Until'),
189 'description' => ts('expires ignore_severity. NULL never hushes.'),
191 'where' => 'civicrm_status_pref.hush_until',
194 'table_name' => 'civicrm_status_pref',
195 'entity' => 'StatusPreference',
196 'bao' => 'CRM_Core_BAO_StatusPreference',
200 'ignore_severity' => [
201 'name' => 'ignore_severity',
202 'type' => CRM_Utils_Type
::T_INT
,
203 'title' => ts('Ignore Severity'),
204 'description' => ts('Hush messages up to and including this severity.'),
206 'where' => 'civicrm_status_pref.ignore_severity',
209 'table_name' => 'civicrm_status_pref',
210 'entity' => 'StatusPreference',
211 'bao' => 'CRM_Core_BAO_StatusPreference',
213 'pseudoconstant' => [
214 'callback' => 'CRM_Utils_Check::getSeverityList',
220 'type' => CRM_Utils_Type
::T_STRING
,
221 'title' => ts('Status Preferences'),
222 'description' => ts('These settings are per-check, and can\'t be compared across checks.'),
224 'size' => CRM_Utils_Type
::HUGE
,
225 'where' => 'civicrm_status_pref.prefs',
226 'table_name' => 'civicrm_status_pref',
227 'entity' => 'StatusPreference',
228 'bao' => 'CRM_Core_BAO_StatusPreference',
233 'name' => 'check_info',
234 'type' => CRM_Utils_Type
::T_STRING
,
235 'title' => ts('Check Info'),
236 'description' => ts('These values are per-check, and can\'t be compared across checks.'),
238 'size' => CRM_Utils_Type
::HUGE
,
239 'where' => 'civicrm_status_pref.check_info',
240 'table_name' => 'civicrm_status_pref',
241 'entity' => 'StatusPreference',
242 'bao' => 'CRM_Core_BAO_StatusPreference',
247 'name' => 'is_active',
248 'type' => CRM_Utils_Type
::T_BOOLEAN
,
249 'title' => ts('Check Is Active'),
250 'description' => ts('Is this status check active?'),
251 'where' => 'civicrm_status_pref.is_active',
253 'table_name' => 'civicrm_status_pref',
254 'entity' => 'StatusPreference',
255 'bao' => 'CRM_Core_BAO_StatusPreference',
260 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
262 return Civi
::$statics[__CLASS__
]['fields'];
266 * Return a mapping from field-name to the corresponding key (as used in fields()).
269 * Array(string $name => string $uniqueName).
271 public static function &fieldKeys() {
272 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
273 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
275 return Civi
::$statics[__CLASS__
]['fieldKeys'];
279 * Returns the names of this table
283 public static function getTableName() {
284 return self
::$_tableName;
288 * Returns if this table needs to be logged
292 public function getLog() {
297 * Returns the list of fields that can be imported
299 * @param bool $prefix
303 public static function &import($prefix = FALSE) {
304 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'status_pref', $prefix, []);
309 * Returns the list of fields that can be exported
311 * @param bool $prefix
315 public static function &export($prefix = FALSE) {
316 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'status_pref', $prefix, []);
321 * Returns the list of indices
323 * @param bool $localize
327 public static function indices($localize = TRUE) {
329 'UI_status_pref_name' => [
330 'name' => 'UI_status_pref_name',
334 'localizable' => FALSE,
335 'sig' => 'civicrm_status_pref::0::name',
338 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;