Skip to content

Commit a38f446

Browse files
committed
Version 0.67
2 parents 78148a3 + f9810e6 commit a38f446

6 files changed

Lines changed: 22 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# (MODX)EvolutionCMS.libraries.ddTools changelog
22

33

4+
## Version 0.67 (2025-11-25)
5+
6+
* \+ `\DDTools\Tools\Objects::convertType` → Parameters → `$params->object` → Valid values → `object`: Custom class instances are now also supported.
7+
8+
49
## Version 0.66 (2025-10-22)
510

611
* \+ `\DDTools\Base\Base::getClassName()` → Result → `$result->namespacePrefixRoot`: The new result property contains the root namespace prefix (e. g. `'\\ddSendFeedback'` of `'\\ddSendFeedback\\Sender\\Email\\Sender'`).

CHANGELOG_ru.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# (MODX)EvolutionCMS.libraries.ddTools changelog
22

33

4+
## Версия 0.67 (2025-11-25)
5+
6+
* \+ `\DDTools\Tools\Objects::convertType` → Параметры → `$params->object` → Допустимые значения → `object`: Теперь также поддерживаются экземпляры кастомных классов.
7+
8+
49
## Версия 0.66 (2025-10-22)
510

611
* \+ `\DDTools\Base\Base::getClassName()` → Результат → `$result->namespacePrefixRoot`: Новое свойство, содержащее корневой префикс пространства имён (например, `'\\ddSendFeedback'` из `'\\ddSendFeedback\\Sender\\Email\\Sender'`).

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ Arrays, [JSON](https://en.wikipedia.org/wiki/JSON) and [Query string](https://en
431431
* Description: Input object | array | encoded string.
432432
* Valid values:
433433
* `stdClass`
434+
* `object` — custom class instances are also supported
434435
* `array`
435436
* `stringJsonObject` — [JSON](https://en.wikipedia.org/wiki/JSON) object
436437
* `stringJsonArray` — [JSON](https://en.wikipedia.org/wiki/JSON) array

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dd/evolutioncms-libraries-ddtools",
33
"type": "modxevo-library-ddtools",
4-
"version": "0.66.0",
4+
"version": "0.67.0",
55
"description": "A library with various tools facilitating your work.",
66
"keywords": [
77
"modx",

modx.ddtools.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* EvolutionCMS.libraries.ddTools
4-
* @version 0.66 (2025-10-22)
4+
* @version 0.67 (2025-11-25)
55
*
66
* @see README.md
77
*

src/Tools/Objects.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static function getPropValue($params){
147147

148148
/**
149149
* convertType
150-
* @version 1.3.3 (2024-08-18)
150+
* @version 1.4 (2025-11-25)
151151
*
152152
* @see README.md
153153
*/
@@ -244,6 +244,14 @@ public static function convertType($params){
244244

245245
// stdClass
246246
if ($params->type == 'objectstdclass'){
247+
// Support custom classes
248+
if (
249+
is_object($result)
250+
&& !($result instanceof \stdClass)
251+
){
252+
$result = (array) $result;
253+
}
254+
247255
$result = (object) $result;
248256
// array
249257
}elseif ($params->type == 'objectarray'){

0 commit comments

Comments
 (0)