mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-03 19:24:59 +02:00
51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Concerns\Repositories\Admin;
|
|
|
|
use App\Actions\Repositories\Admin\Dump\ReconcileDumpRepositoriesAction;
|
|
use App\Actions\Repositories\ReconcileRepositoriesAction;
|
|
use App\Contracts\Repositories\RepositoryInterface;
|
|
use App\Repositories\Eloquent\Admin\DumpRepository as DumpDestinationRepository;
|
|
use App\Repositories\Storage\Admin\DumpRepository as DumpSourceRepository;
|
|
use Illuminate\Support\Facades\App;
|
|
|
|
/**
|
|
* Trait ReconcilesDumpRepositories.
|
|
*/
|
|
trait ReconcilesDumpRepositories
|
|
{
|
|
/**
|
|
* Get source repository for action.
|
|
*
|
|
* @param array $data
|
|
* @return RepositoryInterface|null
|
|
*/
|
|
protected function getSourceRepository(array $data = []): ?RepositoryInterface
|
|
{
|
|
return App::make(DumpSourceRepository::class);
|
|
}
|
|
|
|
/**
|
|
* Get destination repository for action.
|
|
*
|
|
* @param array $data
|
|
* @return RepositoryInterface|null
|
|
*/
|
|
protected function getDestinationRepository(array $data = []): ?RepositoryInterface
|
|
{
|
|
return App::make(DumpDestinationRepository::class);
|
|
}
|
|
|
|
/**
|
|
* Get the reconcile action.
|
|
*
|
|
* @return ReconcileRepositoriesAction
|
|
*/
|
|
protected function reconcileAction(): ReconcileRepositoriesAction
|
|
{
|
|
return new ReconcileDumpRepositoriesAction();
|
|
}
|
|
}
|