Push beginning of DB deletion stuff

This commit is contained in:
Dane Everitt 2018-08-25 14:43:21 -07:00
parent c28e9c1ab7
commit 9be2aa4ca9
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
9 changed files with 120 additions and 16 deletions

View file

@ -5,6 +5,7 @@ namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\Database;
use League\Fractal\Resource\Item;
use Illuminate\Contracts\Encryption\Encrypter;
use Pterodactyl\Contracts\Extensions\HashidsInterface;
class DatabaseTransformer extends BaseClientTransformer
{
@ -15,14 +16,21 @@ class DatabaseTransformer extends BaseClientTransformer
*/
private $encrypter;
/**
* @var \Pterodactyl\Contracts\Extensions\HashidsInterface
*/
private $hashids;
/**
* Handle dependency injection.
*
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
* @param \Pterodactyl\Contracts\Extensions\HashidsInterface $hashids
*/
public function handle(Encrypter $encrypter)
public function handle(Encrypter $encrypter, HashidsInterface $hashids)
{
$this->encrypter = $encrypter;
$this->hashids = $hashids;
}
/**
@ -42,6 +50,7 @@ class DatabaseTransformer extends BaseClientTransformer
$model->loadMissing('host');
return [
'id' => $this->hashids->encode($model->id),
'host' => [
'address' => $model->getRelation('host')->host,
'port' => $model->getRelation('host')->port,