From fc14e864e39dc77c084c41a1ef51311c7f1ba628 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Sat, 25 Sep 2021 14:03:45 -0400 Subject: [PATCH] unused function --- CRM/Core/Form.php | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index e139e04262..b04744fded 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -141,9 +141,6 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * e.g on a form declare $_dateFields = array( * 'receive_date' => array('default' => 'now'), * ); - * then in postProcess call $this->convertDateFieldsToMySQL($formValues) - * to have the time field re-incorporated into the field & 'now' set if - * no value has been passed in */ protected $_dateFields = []; @@ -2149,35 +2146,6 @@ class CRM_Core_Form extends HTML_QuickForm_Page { CRM_Utils_Array::remove($props, 'multiple', 'select', 'api', 'entity', 'create'); } - /** - * Convert all date fields within the params to mysql date ready for the - * BAO layer. In this case fields are checked against the $_datefields defined for the form - * and if time is defined it is incorporated - * - * @param array $params - * Input params from the form. - * - * @todo it would probably be better to work on $this->_params than a passed array - * @todo standardise the format which dates are passed to the BAO layer in & remove date - * handling from BAO - */ - public function convertDateFieldsToMySQL(&$params) { - foreach ($this->_dateFields as $fieldName => $specs) { - if (!empty($params[$fieldName])) { - $params[$fieldName] = CRM_Utils_Date::isoToMysql( - CRM_Utils_Date::processDate( - $params[$fieldName], - CRM_Utils_Array::value("{$fieldName}_time", $params), TRUE) - ); - } - else { - if (isset($specs['default'])) { - $params[$fieldName] = date('YmdHis', strtotime($specs['default'])); - } - } - } - } - /** * @param $elementName */ -- 2.25.1