2020-04-04 17:59:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Backup;
|
2021-08-07 20:06:45 +00:00
|
|
|
use Pterodactyl\Transformers\Api\Transformer;
|
2020-04-04 17:59:25 +00:00
|
|
|
|
2021-08-07 20:06:45 +00:00
|
|
|
class BackupTransformer extends Transformer
|
2020-04-04 17:59:25 +00:00
|
|
|
{
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
|
|
|
return Backup::RESOURCE_NAME;
|
|
|
|
}
|
|
|
|
|
2021-08-07 20:06:45 +00:00
|
|
|
public function transform(Backup $backup): array
|
2020-04-04 17:59:25 +00:00
|
|
|
{
|
|
|
|
return [
|
|
|
|
'uuid' => $backup->uuid,
|
2020-08-21 04:07:53 +00:00
|
|
|
'is_successful' => $backup->is_successful,
|
2021-05-04 04:26:09 +00:00
|
|
|
'is_locked' => $backup->is_locked,
|
2020-04-04 17:59:25 +00:00
|
|
|
'name' => $backup->name,
|
2020-04-04 19:26:39 +00:00
|
|
|
'ignored_files' => $backup->ignored_files,
|
2020-08-24 01:06:47 +00:00
|
|
|
'checksum' => $backup->checksum,
|
2020-04-04 17:59:25 +00:00
|
|
|
'bytes' => $backup->bytes,
|
2021-08-07 20:06:45 +00:00
|
|
|
'created_at' => self::formatTimestamp($backup->created_at),
|
|
|
|
'completed_at' => self::formatTimestamp($backup->completed_at),
|
2020-04-04 17:59:25 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|