blue-twilight/app/Helpers/AnalysisQueueHelper.php

27 lines
643 B
PHP

<?php
namespace App\Helpers;
use App\AlbumSources\IAnalysisQueueSource;
use App\Facade\UserConfig;
use App\Storage;
class AnalysisQueueHelper
{
/**
* Gets the storage queue source in use.
* @return IAnalysisQueueSource
*/
public static function getStorageQueueSource()
{
$queueStorage = Storage::find(UserConfig::get('analysis_queue_storage_location'));
$fullClassName = sprintf('App\AlbumSources\%s', $queueStorage->source);
/** @var IAnalysisQueueSource $source */
$source = new $fullClassName;
$source->setConfiguration($queueStorage);
return $source;
}
}