From ec7c4c44e7fc1aca8f43bdc86697a4785c125042 Mon Sep 17 00:00:00 2001 From: Adrien <af@brain-networks.fr> Date: Mon, 31 Dec 2018 17:33:33 +0100 Subject: [PATCH] utils construct php7 --- include/utils/RecurringType.php | 11 +++++++++-- include/utils/export.php | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/include/utils/RecurringType.php b/include/utils/RecurringType.php index 0d2d56a58..f7ce0af3c 100644 --- a/include/utils/RecurringType.php +++ b/include/utils/RecurringType.php @@ -31,8 +31,9 @@ class RecurringType { * Constructor for class RecurringType * @param array $repeat_arr - array contains recurring info */ - function RecurringType($repeat_arr) { - + function __construct($repeat_arr) + { + $st_date = explode("-", $repeat_arr["startdate"]); $st_time = explode(":", $repeat_arr["starttime"]); $end_date = explode("-", $repeat_arr["enddate"]); @@ -75,6 +76,12 @@ class RecurringType { $this->recurringdates = $this->_getRecurringDates(); } + function RecurringType($repeat_arr) { + // PHP4-style constructor. + // This will NOT be invoked, unless a sub-class that extends `foo` calls it. + // In that case, call the new-style constructor to keep compatibility. + self::__construct($repeat_arr); + } public static function fromUserRequest($requestArray) { // All the information from the user is received in User Time zone diff --git a/include/utils/export.php b/include/utils/export.php index 41720fbd1..0fb897570 100755 --- a/include/utils/export.php +++ b/include/utils/export.php @@ -276,9 +276,16 @@ class ExportUtils{ var $fieldsArr = array(); var $picklistValues = array(); - function ExportUtils($module, $fields_array){ + function __construct($module, $fields_array) + { self::__init($module, $fields_array); } + function ExportUtils($module, $fields_array){ + // PHP4-style constructor. + // This will NOT be invoked, unless a sub-class that extends calls it. + // In that case, call the new-style constructor to keep compatibility. + self::__construct($module, $fields_array); + } function __init($module, $fields_array){ -- GitLab