2017-09-10 06:55:21 +02:00
|
|
|
<?php
|
|
|
|
|
2017-09-13 06:45:19 +02:00
|
|
|
namespace Pterodactyl\Contracts\Repository;
|
2017-09-10 06:55:21 +02:00
|
|
|
|
2017-10-28 04:42:53 +02:00
|
|
|
use Pterodactyl\Models\Schedule;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
2017-09-13 06:45:19 +02:00
|
|
|
interface ScheduleRepositoryInterface extends RepositoryInterface
|
2017-09-10 06:55:21 +02:00
|
|
|
{
|
2017-09-13 06:45:19 +02:00
|
|
|
/**
|
|
|
|
* Return all of the schedules for a given server.
|
|
|
|
*
|
|
|
|
* @param int $server
|
2017-10-28 04:42:53 +02:00
|
|
|
* @return \Illuminate\Support\Collection
|
2017-09-13 06:45:19 +02:00
|
|
|
*/
|
2017-10-28 04:42:53 +02:00
|
|
|
public function findServerSchedules(int $server): Collection;
|
2017-09-10 06:55:21 +02:00
|
|
|
|
2018-01-09 04:43:10 +01:00
|
|
|
/**
|
|
|
|
* Load the tasks relationship onto the Schedule module if they are not
|
|
|
|
* already present.
|
|
|
|
*
|
|
|
|
* @param \Pterodactyl\Models\Schedule $schedule
|
|
|
|
* @param bool $refresh
|
|
|
|
* @return \Pterodactyl\Models\Schedule
|
|
|
|
*/
|
|
|
|
public function loadTasks(Schedule $schedule, bool $refresh = false): Schedule;
|
|
|
|
|
2017-09-13 06:45:19 +02:00
|
|
|
/**
|
|
|
|
* Return a schedule model with all of the associated tasks as a relationship.
|
|
|
|
*
|
|
|
|
* @param int $schedule
|
2017-10-28 04:42:53 +02:00
|
|
|
* @return \Pterodactyl\Models\Schedule
|
|
|
|
*
|
|
|
|
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
2017-09-13 06:45:19 +02:00
|
|
|
*/
|
2017-10-28 04:42:53 +02:00
|
|
|
public function getScheduleWithTasks(int $schedule): Schedule;
|
2017-09-17 06:10:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return all of the schedules that should be processed.
|
|
|
|
*
|
|
|
|
* @param string $timestamp
|
|
|
|
* @return \Illuminate\Support\Collection
|
|
|
|
*/
|
2018-01-05 05:49:50 +01:00
|
|
|
public function getSchedulesToProcess(string $timestamp): Collection;
|
2017-09-10 06:55:21 +02:00
|
|
|
}
|