Support functionality for per-egg features

This commit is contained in:
Dane Everitt 2020-11-02 20:20:36 -08:00
parent 7ec614ed2c
commit 7618f306bd
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
7 changed files with 70 additions and 20 deletions

View file

@ -33,19 +33,15 @@ class EggUpdateService
/**
* Update a service option.
*
* @param int|\Pterodactyl\Models\Egg $egg
* @param \Pterodactyl\Models\Egg $egg
* @param array $data
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
* @throws \Pterodactyl\Exceptions\Service\Egg\NoParentConfigurationFoundException
*/
public function handle($egg, array $data)
public function handle(Egg $egg, array $data)
{
if (! $egg instanceof Egg) {
$egg = $this->repository->find($egg);
}
if (! is_null(array_get($data, 'config_from'))) {
$results = $this->repository->findCountWhere([
['nest_id', '=', $egg->nest_id],