2019-11-03 20:20:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Subuser;
|
2021-08-07 20:06:45 +00:00
|
|
|
use Pterodactyl\Transformers\Api\Transformer;
|
2019-11-03 20:20:11 +00:00
|
|
|
|
2021-08-07 20:06:45 +00:00
|
|
|
class SubuserTransformer extends Transformer
|
2019-11-03 20:20:11 +00:00
|
|
|
{
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
|
|
|
return Subuser::RESOURCE_NAME;
|
|
|
|
}
|
|
|
|
|
2021-08-07 20:06:45 +00:00
|
|
|
public function transform(Subuser $model): array
|
2019-11-03 20:20:11 +00:00
|
|
|
{
|
2020-03-27 21:23:13 +00:00
|
|
|
return array_merge(
|
2021-08-07 20:06:45 +00:00
|
|
|
(new UserTransformer())->transform($model->user),
|
2020-03-27 21:23:13 +00:00
|
|
|
['permissions' => $model->permissions]
|
|
|
|
);
|
2019-11-03 20:20:11 +00:00
|
|
|
}
|
|
|
|
}
|