misc_pterodactyl-panel/app/Transformers/Api/Client/BackupTransformer.php

30 lines
824 B
PHP
Raw Permalink Normal View History

<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\Backup;
2022-12-15 00:05:46 +00:00
use Pterodactyl\Transformers\Api\Transformer;
2022-12-15 00:05:46 +00:00
class BackupTransformer extends Transformer
{
public function getResourceName(): string
{
return Backup::RESOURCE_NAME;
}
2022-12-15 00:05:46 +00:00
public function transform(Backup $model): array
{
return [
2022-12-15 00:05:46 +00:00
'uuid' => $model->uuid,
'is_successful' => $model->is_successful,
'is_locked' => $model->is_locked,
'name' => $model->name,
'ignored_files' => $model->ignored_files,
'checksum' => $model->checksum,
'bytes' => $model->bytes,
'created_at' => self::formatTimestamp($model->created_at),
'completed_at' => self::formatTimestamp($model->completed_at),
];
}
}