54b6fb5ebd
Also corrects API format to maintain JSONAPI spec
31 lines
743 B
PHP
31 lines
743 B
PHP
<?php
|
|
|
|
namespace Pterodactyl\Transformers\Api\Admin;
|
|
|
|
use Pterodactyl\Models\Allocation;
|
|
use Pterodactyl\Transformers\Api\ApiTransformer;
|
|
|
|
class AllocationTransformer extends ApiTransformer
|
|
{
|
|
/**
|
|
* Return a generic transformed allocation array.
|
|
*
|
|
* @param \Pterodactyl\Models\Allocation $allocation
|
|
* @return array
|
|
*/
|
|
public function transform(Allocation $allocation)
|
|
{
|
|
return $this->transformWithFilter($allocation);
|
|
}
|
|
|
|
/**
|
|
* Determine which transformer filter to apply.
|
|
*
|
|
* @param \Pterodactyl\Models\Allocation $allocation
|
|
* @return array
|
|
*/
|
|
protected function transformWithFilter(Allocation $allocation)
|
|
{
|
|
return $allocation->toArray();
|
|
}
|
|
}
|