copyValues($params); if ($dao->find(TRUE)) { CRM_Core_DAO::storeValues($dao, $defaults); return $dao; } return NULL; } /** * Update the is_active flag in the db. * * @param int $id * Id of the database record. * @param bool $is_active * Value we want to set the is_active field. */ public static function setIsActive($id, $is_active) { CRM_Core_Error::fatal(); } /** * Delete preference dates. * * @param int $id */ public static function del($id) { CRM_Core_Error::fatal(); } /** * (Setting Callback - On Change) * Respond to changes in the "timeInputFormat" setting. * * @param array $oldValue * List of component names. * @param array $newValue * List of component names. * @param array $metadata * Specification of the setting (per *.settings.php). */ public static function onChangeSetting($oldValue, $newValue, $metadata) { if ($oldValue == $newValue) { return; } $query = " UPDATE civicrm_preferences_date SET time_format = %1 WHERE time_format IS NOT NULL AND time_format <> '' "; $sqlParams = [1 => [$newValue, 'String']]; CRM_Core_DAO::executeQuery($query, $sqlParams); } }