$v) { $cleaned[$k] = self::recursivelyRemoveSensitiveKeys($v, $sensitiveKeys); } return $cleaned; } /** * Convert ObjectModelCore and children to array. * * @param ObjectModelCore $obj * @return mixed */ protected static function objectToArray(ObjectModelCore $obj) { return json_decode(json_encode($obj), true); } /** * Convert date and time from local timezone to UTC. * * @param $date * @return string */ protected static function convertDateStringToUTC($date) { $shopTimezone = new DateTimeZone(Configuration::get('PS_TIMEZONE')); $datetime = DateTime::createFromFormat(self::DATE_TIME_FORMAT, $date, $shopTimezone); return $datetime->setTimezone(new DateTimeZone('UTC'))->format(self::DATE_TIME_FORMAT); } }