[CORE][DB] Fix uses of db tables after previous restructure

This commit is contained in:
Hugo Sales
2020-08-13 01:23:22 +00:00
committed by Hugo Sales
parent e0af29fd5e
commit 0508886fc4
8 changed files with 38 additions and 31 deletions

View File

@@ -62,7 +62,7 @@ class Controller extends AbstractController implements EventSubscriberInterface
$controller = $event->getController();
$request = $event->getRequest();
if (($user = Common::user()) !== null && ($avatar = DB::find('avatar', ['profile_id' => $user->getProfile()->getId()])) != null) {
if (($user = Common::user()) !== null && ($avatar = DB::find('avatar', ['gsactor_id' => $user->getActor()->getId()])) != null) {
$avatar_filename = $avatar->getUrl();
} else {
$avatar_filename = '/public/assets/default_avatar.svg';

View File

@@ -100,6 +100,9 @@ abstract class DB
$args[0] = '\App\Entity\\' . ucfirst(Formatting::snakeCaseToCamelCase($args[0]));
}
}
if (($args[0] ?? '') === '\App\Entity\Gsactor') {
$args[0] = '\App\Entity\GSActor';
}
return self::$em->{$name}(...$args);
}