forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAllocationTransformer.php
More file actions
36 lines (32 loc) · 851 Bytes
/
AllocationTransformer.php
File metadata and controls
36 lines (32 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\Allocation;
class AllocationTransformer extends BaseClientTransformer
{
/**
* Return the resource name for the JSONAPI output.
*
* @return string
*/
public function getResourceName(): string
{
return 'allocation';
}
/**
* Return basic information about the currently logged in user.
*
* @param \Pterodactyl\Models\Allocation $model
* @return array
*/
public function transform(Allocation $model)
{
return [
'id' => $model->id,
'ip' => $model->ip,
'ip_alias' => $model->ip_alias,
'port' => $model->port,
'notes' => $model->notes,
'is_default' => $model->server->allocation_id === $model->id,
];
}
}