2020-12-28 19:47:08 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Application;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\AdminRole;
|
|
|
|
|
|
|
|
class AdminRoleTransformer extends BaseTransformer
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return the resource name for the JSONAPI output.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
|
|
|
return AdminRole::RESOURCE_NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-01-05 21:52:49 +00:00
|
|
|
* Return a transformed AdminRole model that can be consumed by external services.
|
2020-12-28 19:47:08 +00:00
|
|
|
*
|
2021-01-01 22:55:30 +00:00
|
|
|
* @param \Pterodactyl\Models\AdminRole $model
|
2020-12-28 19:47:08 +00:00
|
|
|
* @return array
|
|
|
|
*/
|
2021-01-01 22:55:30 +00:00
|
|
|
public function transform(AdminRole $model): array
|
2020-12-28 19:47:08 +00:00
|
|
|
{
|
|
|
|
return [
|
2021-01-01 22:55:30 +00:00
|
|
|
'id' => $model->id,
|
|
|
|
'name' => $model->name,
|
|
|
|
'description' => $model->description,
|
2020-12-28 19:47:08 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|