Commit f74be4d4 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Prise en compte de has comme getter

parent 876032f3
Loading
Loading
Loading
Loading
+6 −6
Changes for module/Application/src/Controller/Plugin/Axios.php: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -51,16 +51,16 @@ class Axios extends AbstractPlugin
                }

                if ($property == 'id') continue;
                $method     = 'get' . ucfirst($property);

                $foundValue = false;

                $prefixes = ['get', 'is', 'has'];
                foreach ($prefixes as $prefix) {
                    $method = $prefix . ucfirst($property);
                    if (method_exists($object, $method)) {
                        $value      = $object->$method();
                        $foundValue = true;
                } else {
                    $method = 'is' . ucfirst($property);
                    if (method_exists($object, $method)) {
                        $value      = $object->$method();
                        $foundValue = true;
                        break;
                    }
                }