3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 class CRM_Core_BAO_PreferencesDate
extends CRM_Core_DAO_PreferencesDate
{
20 * Static holder for the default LT.
23 public static $_defaultPreferencesDate = NULL;
28 public function __construct() {
29 parent
::__construct();
33 * Fetch object based on array of properties.
35 * @param array $params
36 * (reference ) an assoc array of name/value pairs.
37 * @param array $defaults
38 * (reference ) an assoc array to hold the flattened values.
40 * @return CRM_Core_BAO_PreferencesDate|null
41 * object on success, null otherwise
43 public static function retrieve(&$params, &$defaults) {
44 $dao = new CRM_Core_DAO_PreferencesDate();
45 $dao->copyValues($params);
46 if ($dao->find(TRUE)) {
47 CRM_Core_DAO
::storeValues($dao, $defaults);
54 * Update the is_active flag in the db.
57 * Id of the database record.
58 * @param bool $is_active
59 * Value we want to set the is_active field.
61 public static function setIsActive($id, $is_active) {
62 CRM_Core_Error
::fatal();
66 * Delete preference dates.
70 public static function del($id) {
71 CRM_Core_Error
::fatal();
75 * (Setting Callback - On Change)
76 * Respond to changes in the "timeInputFormat" setting.
78 * @param array $oldValue
79 * List of component names.
80 * @param array $newValue
81 * List of component names.
82 * @param array $metadata
83 * Specification of the setting (per *.settings.php).
85 public static function onChangeSetting($oldValue, $newValue, $metadata) {
86 if ($oldValue == $newValue) {
91 UPDATE civicrm_preferences_date
93 WHERE time_format IS NOT NULL
96 $sqlParams = [1 => [$newValue, 'String']];
97 CRM_Core_DAO
::executeQuery($query, $sqlParams);