misc_pterodactyl-panel/app/Transformers/Api/Client/BackupTransformer.php
Matthew Penner cbcf62086f
Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2022-10-14 10:59:20 -06:00

28 lines
815 B
PHP

<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\Backup;
class BackupTransformer extends BaseClientTransformer
{
public function getResourceName(): string
{
return Backup::RESOURCE_NAME;
}
public function transform(Backup $backup): array
{
return [
'uuid' => $backup->uuid,
'is_successful' => $backup->is_successful,
'is_locked' => $backup->is_locked,
'name' => $backup->name,
'ignored_files' => $backup->ignored_files,
'checksum' => $backup->checksum,
'bytes' => $backup->bytes,
'created_at' => $backup->created_at->toAtomString(),
'completed_at' => $backup->completed_at ? $backup->completed_at->toAtomString() : null,
];
}
}