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:97f98c6f510e57260d2a5e3647a00d4f)
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',
148 'name' => 'domain_id',
149 'type' => CRM_Utils_Type
::T_INT
,
150 'title' => ts('Domain ID'),
151 'description' => ts('Which Domain is this Status Preference for'),
153 'where' => 'civicrm_status_pref.domain_id',
154 'table_name' => 'civicrm_status_pref',
155 'entity' => 'StatusPreference',
156 'bao' => 'CRM_Core_BAO_StatusPreference',
158 'FKClassName' => 'CRM_Core_DAO_Domain',
160 'label' => ts("Domain"),
162 'pseudoconstant' => [
163 'table' => 'civicrm_domain',
165 'labelColumn' => 'name',
171 'type' => CRM_Utils_Type
::T_STRING
,
172 'title' => ts('Status Check Name'),
173 'description' => ts('Name of the status check this preference references.'),
176 'size' => CRM_Utils_Type
::HUGE
,
178 'where' => 'civicrm_status_pref.name',
180 'table_name' => 'civicrm_status_pref',
181 'entity' => 'StatusPreference',
182 'bao' => 'CRM_Core_BAO_StatusPreference',
187 'name' => 'hush_until',
188 'type' => CRM_Utils_Type
::T_DATE
,
189 'title' => ts('Snooze Status Notifications Until'),
190 'description' => ts('expires ignore_severity. NULL never hushes.'),
192 'where' => 'civicrm_status_pref.hush_until',
195 'table_name' => 'civicrm_status_pref',
196 'entity' => 'StatusPreference',
197 'bao' => 'CRM_Core_BAO_StatusPreference',
201 'ignore_severity' => [
202 'name' => 'ignore_severity',
203 'type' => CRM_Utils_Type
::T_INT
,
204 'title' => ts('Ignore Severity'),
205 'description' => ts('Hush messages up to and including this severity.'),
207 'where' => 'civicrm_status_pref.ignore_severity',
210 'table_name' => 'civicrm_status_pref',
211 'entity' => 'StatusPreference',
212 'bao' => 'CRM_Core_BAO_StatusPreference',
214 'pseudoconstant' => [
215 'callback' => 'CRM_Utils_Check::getSeverityList',
221 'type' => CRM_Utils_Type
::T_STRING
,
222 'title' => ts('Status Preferences'),
223 'description' => ts('These settings are per-check, and can\'t be compared across checks.'),
225 'size' => CRM_Utils_Type
::HUGE
,
226 'where' => 'civicrm_status_pref.prefs',
227 'table_name' => 'civicrm_status_pref',
228 'entity' => 'StatusPreference',
229 'bao' => 'CRM_Core_BAO_StatusPreference',
234 'name' => 'check_info',
235 'type' => CRM_Utils_Type
::T_STRING
,
236 'title' => ts('Check Info'),
237 'description' => ts('These values are per-check, and can\'t be compared across checks.'),
239 'size' => CRM_Utils_Type
::HUGE
,
240 'where' => 'civicrm_status_pref.check_info',
241 'table_name' => 'civicrm_status_pref',
242 'entity' => 'StatusPreference',
243 'bao' => 'CRM_Core_BAO_StatusPreference',
248 'name' => 'is_active',
249 'type' => CRM_Utils_Type
::T_BOOLEAN
,
250 'title' => ts('Check Is Active'),
251 'description' => ts('Is this status check active?'),
252 'where' => 'civicrm_status_pref.is_active',
254 'table_name' => 'civicrm_status_pref',
255 'entity' => 'StatusPreference',
256 'bao' => 'CRM_Core_BAO_StatusPreference',
261 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
263 return Civi
::$statics[__CLASS__
]['fields'];
267 * Return a mapping from field-name to the corresponding key (as used in fields()).
270 * Array(string $name => string $uniqueName).
272 public static function &fieldKeys() {
273 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
274 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
276 return Civi
::$statics[__CLASS__
]['fieldKeys'];
280 * Returns the names of this table
284 public static function getTableName() {
285 return self
::$_tableName;
289 * Returns if this table needs to be logged
293 public function getLog() {
298 * Returns the list of fields that can be imported
300 * @param bool $prefix
304 public static function &import($prefix = FALSE) {
305 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'status_pref', $prefix, []);
310 * Returns the list of fields that can be exported
312 * @param bool $prefix
316 public static function &export($prefix = FALSE) {
317 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'status_pref', $prefix, []);
322 * Returns the list of indices
324 * @param bool $localize
328 public static function indices($localize = TRUE) {
330 'UI_status_pref_name' => [
331 'name' => 'UI_status_pref_name',
335 'localizable' => FALSE,
336 'sig' => 'civicrm_status_pref::0::name',
339 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;