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 * Retrieve DB object and copy to defaults array.
22 * @param array $params
23 * Array of criteria values.
24 * @param array $defaults
25 * Array to be populated with found values.
28 * The DAO object, if found.
32 public static function retrieve($params, &$defaults) {
33 return self
::commonRetrieve(self
::class, $params, $defaults);
37 * Update the is_active flag in the db.
40 * Id of the database record.
41 * @param bool $is_active
42 * Value we want to set the is_active field.
43 * @throws CRM_Core_Exception
45 public static function setIsActive($id, $is_active) {
46 throw new CRM_Core_Exception('Cannot call setIsActive function');
50 * Delete preference dates.
53 * @throws CRM_Core_Exception
55 public static function del($id) {
56 throw new CRM_Core_Exception('Cannot call del function');
60 * (Setting Callback - On Change)
61 * Respond to changes in the "timeInputFormat" setting.
63 * @param array $oldValue
64 * List of component names.
65 * @param array $newValue
66 * List of component names.
67 * @param array $metadata
68 * Specification of the setting (per *.settings.php).
70 public static function onChangeSetting($oldValue, $newValue, $metadata) {
71 if ($oldValue == $newValue) {
76 UPDATE civicrm_preferences_date
78 WHERE time_format IS NOT NULL
81 $sqlParams = [1 => [$newValue, 'String']];
82 CRM_Core_DAO
::executeQuery($query, $sqlParams);