Finalize service option import/export

This commit is contained in:
Dane Everitt
2017-10-03 23:31:04 -05:00
parent d608c313c3
commit 6269a08db7
16 changed files with 405 additions and 271 deletions

View File

@@ -61,6 +61,25 @@ class ServiceOptionRepository extends EloquentRepository implements ServiceOptio
return $instance;
}
/**
* Return all of the data needed to export a service.
*
* @param int $id
* @return \Pterodactyl\Models\ServiceOption
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function getWithExportAttributes(int $id): ServiceOption
{
/** @var \Pterodactyl\Models\ServiceOption $instance */
$instance = $this->getBuilder()->with('scriptFrom', 'configFrom', 'variables')->find($id, $this->getColumns());
if (! $instance) {
throw new RecordNotFoundException;
}
return $instance;
}
/**
* Confirm a copy script belongs to the same service as the item trying to use it.
*