mirror of
https://github.com/koel/koel
synced 2024-12-22 18:43:21 +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;
|
|
}
|
|
}
|