2018-08-29 06:15:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
|
|
|
use App\Models\Song;
|
|
|
|
use App\Services\HelperService;
|
|
|
|
|
|
|
|
class SongRepository extends AbstractRepository
|
|
|
|
{
|
|
|
|
private $helperService;
|
|
|
|
|
2019-01-01 11:53:20 +00:00
|
|
|
public function __construct(HelperService $helperService)
|
2018-08-29 06:15:11 +00:00
|
|
|
{
|
2019-01-01 11:53:20 +00:00
|
|
|
parent::__construct();
|
2018-08-29 06:15:11 +00:00
|
|
|
$this->helperService = $helperService;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getModelClass(): string
|
|
|
|
{
|
|
|
|
return Song::class;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getOneByPath(string $path): ?Song
|
|
|
|
{
|
|
|
|
return $this->getOneById($this->helperService->getFileHash($path));
|
|
|
|
}
|
|
|
|
}
|