Commit 3b8bca68 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Possibilité de définir des sous-propriétés

parent 91172524
Loading
Loading
Loading
Loading
+6 −1
Changes for module/Application/src/Controller/Plugin/Axios.php: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ class Axios extends AbstractPlugin
        }
        if (!empty($properties)) {
            foreach ($properties as $property) {
                $subProperties = [];
                if (is_array($property)) {
                    [$property, $subProperties] = $property;
                }

                if ($property == 'id') continue;
                $method     = 'get' . ucfirst($property);
                $foundValue = false;
@@ -64,7 +69,7 @@ class Axios extends AbstractPlugin
                        if ($value instanceof \DateTime) {
                            $value = $value->format(Util::DATE_FORMAT);
                        } else {
                            $value = $this->extract($value);
                            $value = $this->extract($value, $subProperties);
                        }
                    }
                    $result[$property] = $value;