koel/app/Repositories/SongRepository.php
Javier López 7ba295efad Non interactive koel:init (#886)
* Use ADMIN_* variables if available to create the admin account

* Add APP_MEDIA_PATH for media directory

* Use the standard --no-interaction flag to koel:init

* Undo variable aligment and code formatting

* Prefer early return over else, add new line before return statements

* Some fixes
2019-01-01 12:53:20 +01:00

28 lines
588 B
PHP

<?php
namespace App\Repositories;
use App\Models\Song;
use App\Services\HelperService;
use Illuminate\Contracts\Auth\Guard;
class SongRepository extends AbstractRepository
{
private $helperService;
public function __construct(HelperService $helperService)
{
parent::__construct();
$this->helperService = $helperService;
}
public function getModelClass(): string
{
return Song::class;
}
public function getOneByPath(string $path): ?Song
{
return $this->getOneById($this->helperService->getFileHash($path));
}
}