[DB] Add support for calling methods with FQCN
This commit is contained in:
parent
4328a11eb1
commit
ea4f2c522b
@ -107,8 +107,9 @@ abstract class DB
|
|||||||
public static function __callStatic(string $name, array $args)
|
public static function __callStatic(string $name, array $args)
|
||||||
{
|
{
|
||||||
foreach (['find', 'getReference', 'getPartialReference', 'getRepository'] as $m) {
|
foreach (['find', 'getReference', 'getPartialReference', 'getRepository'] as $m) {
|
||||||
if ($name == $m) {
|
$pref = '\App\Entity\\';
|
||||||
$args[0] = '\App\Entity\\' . ucfirst(Formatting::snakeCaseToCamelCase($args[0]));
|
if ($name == $m && Formatting::startsWith($name, $pref) === false) {
|
||||||
|
$args[0] = $pref . ucfirst(Formatting::snakeCaseToCamelCase($args[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user