public function restore()
{
switch ($this->get('type')) {
case 'code':
$type = 'restore_code';
break;
case 'files':
$type = 'restore_files';
break;
case 'database':
$type = 'restore_database';
break;
default:
throw new TerminusException('This backup has no archive to restore.');
break;
}
$workflow = $this->environment->getWorkflows()->create($type, ['params' => ['key' => "{$this->environment->site->id}/{$this->environment->id}/{$this->get('filename')}", 'bucket' => $this->getBucket()]]);
return $workflow;
}