[DATABASE][WRAPPER] Update DATABASE wrapper so entity names are provided without the namespace

This commit is contained in:
Hugo Sales
2020-07-18 02:16:18 +00:00
committed by Hugo Sales
parent 4cc196a69a
commit 91ff4dbdec
4 changed files with 13 additions and 5 deletions

View File

@@ -42,6 +42,12 @@ 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($args[0]);
}
}
return self::$em->{$name}(...$args);
}
}