2020-04-04 17:59:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Backup;
|
|
|
|
|
|
|
|
class BackupTransformer extends BaseClientTransformer
|
|
|
|
{
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
|
|
|
return Backup::RESOURCE_NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function transform(Backup $backup)
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
'created_at' => $backup->created_at->toIso8601String(),
|
2020-04-04 19:26:39 +00:00
|
|
|
'completed_at' => $backup->completed_at ? $backup->completed_at->toIso8601String() : null,
|
2020-04-04 17:59:25 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|