From ea4f2c522b66119c7abfa3b37af2a38e206c5bc5 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Fri, 4 Sep 2020 15:15:03 +0100 Subject: [PATCH] [DB] Add support for calling methods with FQCN --- src/Core/DB/DB.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Core/DB/DB.php b/src/Core/DB/DB.php index 977772cb64..d1ff24abce 100644 --- a/src/Core/DB/DB.php +++ b/src/Core/DB/DB.php @@ -107,8 +107,9 @@ abstract class DB public static function __callStatic(string $name, array $args) { foreach (['find', 'getReference', 'getPartialReference', 'getRepository'] as $m) { - if ($name == $m) { - $args[0] = '\App\Entity\\' . ucfirst(Formatting::snakeCaseToCamelCase($args[0])); + $pref = '\App\Entity\\'; + if ($name == $m && Formatting::startsWith($name, $pref) === false) { + $args[0] = $pref . ucfirst(Formatting::snakeCaseToCamelCase($args[0])); } }