2020-04-04 17:59:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Backup;
|
2022-12-15 00:05:46 +00:00
|
|
|
use Pterodactyl\Transformers\Api\Transformer;
|
2020-04-04 17:59:25 +00:00
|
|
|
|
2022-12-15 00:05:46 +00:00
|
|
|
class BackupTransformer extends Transformer
|
2020-04-04 17:59:25 +00:00
|
|
|
{
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
|
|
|
return Backup::RESOURCE_NAME;
|
|
|
|
}
|
|
|
|
|
2022-12-15 00:05:46 +00:00
|
|
|
public function transform(Backup $model): array
|
2020-04-04 17:59:25 +00:00
|
|
|
{
|
|
|
|
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),
|
2020-04-04 17:59:25 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|