From 29ff9fc85f1c158200feeab748fc2fc0125e5635 Mon Sep 17 00:00:00 2001 From: Ilyas Ronef Date: Mon, 8 Nov 2021 16:14:16 +0300 Subject: [PATCH 1/2] + `\DDTools\ObjectTools::convertType`: Added the ability to return `stringQueryFormated`. --- README.md | 3 ++- src/ObjectTools/ObjectTools.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9db2156..40d3350 100644 --- a/README.md +++ b/README.md @@ -330,7 +330,7 @@ Arrays, [JSON](https://en.wikipedia.org/wiki/JSON) and [Query string](https://en * `stringJsonArray` — [JSON](https://en.wikipedia.org/wiki/JSON) array * `stringHjsonObject` — [HJSON](https://hjson.github.io/) object * `stringHjsonArray` — [HJSON](https://hjson.github.io/) array - * `stringQueryFormated` + * `stringQueryFormated` — [Query string](https://en.wikipedia.org/wiki/Query_string) * **Required** * `$params->type` @@ -343,6 +343,7 @@ Arrays, [JSON](https://en.wikipedia.org/wiki/JSON) and [Query string](https://en * `'stringJsonAuto'` — `stringJsonObject` or `stringJsonArray` depends on input object * `'stringJsonObject'` * `'stringJsonArray'` + * `'stringQueryFormated'` * Default value: `'objectAuto'` diff --git a/src/ObjectTools/ObjectTools.php b/src/ObjectTools/ObjectTools.php index fc78868..d8563e7 100644 --- a/src/ObjectTools/ObjectTools.php +++ b/src/ObjectTools/ObjectTools.php @@ -71,7 +71,7 @@ public static function getPropValue($params){ /** * convertType - * @version 1.1 (2021-03-20) + * @version 1.2 (2021-11-08) * * @see README.md */ @@ -166,6 +166,9 @@ public static function convertType($params){ //array }elseif ($params->type == 'objectarray'){ $result = (array) $result; + //stringQueryFormated + }elseif ($params->type == 'stringqueryformated'){ + $result = http_build_query($result); //stringJson }elseif( substr( From 3e320eb3e0721bbc490ebe15b99c895167f3904e Mon Sep 17 00:00:00 2001 From: Ilyas Ronef Date: Mon, 8 Nov 2021 16:17:11 +0300 Subject: [PATCH 2/2] Prerelease --- CHANGELOG.md | 4 ++++ CHANGELOG_ru.md | 4 ++++ composer.json | 2 +- modx.ddtools.class.php | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee7db42..2ac889c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # (MODX)EvolutionCMS.libraries.ddTools changelog +## Version 0.51 (2021-11-08) +* \+ `\DDTools\ObjectTools::convertType`: Added the ability to return `stringQueryFormated`. + + ## Version 0.50 (2021-05-11) * \+ `\DDTools\Response`: * \+ `setMetaData`: The new public method. Setter for `$this->meta` and `$this->data`. diff --git a/CHANGELOG_ru.md b/CHANGELOG_ru.md index c1d0c93..d2b8fb1 100644 --- a/CHANGELOG_ru.md +++ b/CHANGELOG_ru.md @@ -1,6 +1,10 @@ # (MODX)EvolutionCMS.libraries.ddTools changelog +## Версия 0.51 (2021-11-08) +* \+ `\DDTools\ObjectTools::convertType`: Добавлена возможность конвертировать в `stringQueryFormated`. + + ## Версия 0.50 (2021-05-11) * \+ `\DDTools\Response`: * \+ `setMetaData`: Новый публичный метод. Сеттер для `$this->meta` и `$this->data`. diff --git a/composer.json b/composer.json index 899f585..9841f38 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "dd/evolutioncms-libraries-ddtools", "type": "modxevo-library-ddtools", - "version": "0.50.0", + "version": "0.51.0", "description": "A library with various tools facilitating your work.", "keywords": [ "modx", diff --git a/modx.ddtools.class.php b/modx.ddtools.class.php index 11a9430..7932d98 100644 --- a/modx.ddtools.class.php +++ b/modx.ddtools.class.php @@ -1,7 +1,7 @@