Files

30 lines
744 B
PHP
Raw Permalink Normal View History

2019-11-03 12:20:11 -08:00
<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\Subuser;
class SubuserTransformer extends BaseClientTransformer
{
/**
* Return the resource name for the JSONAPI output.
*/
public function getResourceName(): string
{
return Subuser::RESOURCE_NAME;
}
/**
2019-12-28 12:03:19 -08:00
* Transforms a subuser into a model that can be shown to a front-end user.
2019-11-03 12:20:11 -08:00
*
2019-12-28 12:03:19 -08:00
* @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException
2019-11-03 12:20:11 -08:00
*/
2022-10-14 10:59:20 -06:00
public function transform(Subuser $model): array
2019-11-03 12:20:11 -08:00
{
return array_merge(
$this->makeTransformer(UserTransformer::class)->transform($model->user),
['permissions' => $model->permissions]
);
2019-11-03 12:20:11 -08:00
}
}