Albums: fix getAlbumByPhotoId performance issue

This commit is contained in:
veselcraft 2022-03-25 16:36:38 +03:00
parent 4cf50790b1
commit e6759f089f
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E

View file

@ -119,7 +119,7 @@ class Albums
function getAlbumByPhotoId(Photo $photo): ?Album
{
$dbalbum = DatabaseConnection::i()->getContext()->table("album_relations")->where(["media" => $photo->getId()])->fetch();
$dbalbum = $this->context->table("album_relations")->where(["media" => $photo->getId()])->fetch();
return $dbalbum->collection ? $this->get($dbalbum->collection) : null;
}