mirror of
https://github.com/koel/koel
synced 2024-11-28 15:00:42 +00:00
25 lines
453 B
PHP
25 lines
453 B
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Album;
|
|
use App\Models\Song;
|
|
|
|
class AlbumRepository extends AbstractRepository
|
|
{
|
|
public function getModelClass(): string
|
|
{
|
|
return Album::class;
|
|
}
|
|
|
|
public function getNonEmptyAlbumIds(): array
|
|
{
|
|
$ids = Song::select('album_id')
|
|
->groupBy('album_id')
|
|
->get()
|
|
->pluck('album_id')
|
|
->toArray();
|
|
|
|
return $ids;
|
|
}
|
|
}
|