Forward-ported a new DbHelper method from v2.1 which is now needed for the sitemap.xml generator
This commit is contained in:
parent
1173b2baba
commit
0ce4c368a3
@ -9,6 +9,28 @@ use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DbHelper
|
||||
{
|
||||
private static $allowedAlbumIDs = null;
|
||||
|
||||
public static function getAlbumIDsForCurrentUser()
|
||||
{
|
||||
if (is_null(self::$allowedAlbumIDs))
|
||||
{
|
||||
$query = self::getAlbumsForCurrentUser_NonPaged();
|
||||
$query->select('albums.id');
|
||||
|
||||
$ids = [];
|
||||
|
||||
foreach ($query->get() as $album)
|
||||
{
|
||||
$ids[] = $album->id;
|
||||
}
|
||||
|
||||
self::$allowedAlbumIDs = $ids;
|
||||
}
|
||||
|
||||
return self::$allowedAlbumIDs;
|
||||
}
|
||||
|
||||
public static function getAlbumsForCurrentUser($parentID = -1)
|
||||
{
|
||||
$query = self::getAlbumsForCurrentUser_NonPaged();
|
||||
|
Loading…
Reference in New Issue
Block a user