Pantheon\Terminus\Collections\Backups::create PHP Method

create() public method

Creates a backup
public create ( array $arg_options = [] ) : Workflow
$arg_options array Elements as follow: integer keep-for Days to keep the backup for string element Which element of the site to back up (database, code, files, or null for all)
return Workflow
    public function create(array $arg_options = [])
    {
        $default_options = ['element' => null, 'keep-for' => 365];
        $options = array_merge($default_options, $arg_options);
        $params = ['code' => false, 'database' => false, 'files' => false, 'entry_type' => 'backup'];
        if (!is_null($element = $options['element'])) {
            $params[$element] = true;
        } else {
            $params['code'] = $params['database'] = $params['files'] = true;
        }
        $params['ttl'] = ceil((int) $options['keep-for'] * 86400);
        return $this->getEnvironment()->getWorkflows()->create('do_export', compact('params'));
    }