3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2019 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2019
33 class CRM_Core_BAO_PreferencesDate
extends CRM_Core_DAO_PreferencesDate
{
36 * Static holder for the default LT.
38 static $_defaultPreferencesDate = NULL;
43 public function __construct() {
44 parent
::__construct();
48 * Fetch object based on array of properties.
50 * @param array $params
51 * (reference ) an assoc array of name/value pairs.
52 * @param array $defaults
53 * (reference ) an assoc array to hold the flattened values.
55 * @return CRM_Core_BAO_PreferencesDate|null
56 * object on success, null otherwise
58 public static function retrieve(&$params, &$defaults) {
59 $dao = new CRM_Core_DAO_PreferencesDate();
60 $dao->copyValues($params);
61 if ($dao->find(TRUE)) {
62 CRM_Core_DAO
::storeValues($dao, $defaults);
69 * Update the is_active flag in the db.
72 * Id of the database record.
73 * @param bool $is_active
74 * Value we want to set the is_active field.
76 public static function setIsActive($id, $is_active) {
77 CRM_Core_Error
::fatal();
81 * Delete preference dates.
85 public static function del($id) {
86 CRM_Core_Error
::fatal();
90 * (Setting Callback - On Change)
91 * Respond to changes in the "timeInputFormat" setting.
93 * @param array $oldValue
94 * List of component names.
95 * @param array $newValue
96 * List of component names.
97 * @param array $metadata
98 * Specification of the setting (per *.settings.php).
100 public static function onChangeSetting($oldValue, $newValue, $metadata) {
101 if ($oldValue == $newValue) {
106 UPDATE civicrm_preferences_date
108 WHERE time_format IS NOT NULL
109 AND time_format <> ''
111 $sqlParams = array(1 => array($newValue, 'String'));
112 CRM_Core_DAO
::executeQuery($query, $sqlParams);