PHP Class Pantheon\Terminus\Collections\Backups

Inheritance: extends EnvironmentOwnedCollection
Datei anzeigen Open project: pantheon-systems/terminus Class Usage Examples

Protected Properties

Property Type Description
$collected_class string
$url string

Public Methods

Method Description
cancelBackupSchedule ( ) Cancels an environment's regular backup schedule
create ( array $arg_options = [] ) : Workflow Creates a backup
fetch ( array $options = [] ) : TerminusCollection Fetches model data from API and instantiates its model instances
getBackupByFileName ( string $filename ) : Backup Fetches backup for a specified filename
getBackupSchedule ( ) : array Retrieves an environment's regular backup schedule
getBackupsByElement ( string $element = null ) : Backup[] Lists all backups for a specific element.
getFinishedBackups ( string $element = null ) : Backup[] Filters the backups for only ones which have finished
getValidElements ( ) : string[] Valid backup types
setBackupSchedule ( array $options = ['day' => null, 'hour' => null] ) : Workflow Sets an environment's regular backup schedule

Protected Methods

Method Description
getDayNumber ( string $day ) : integer Retrieve an integer representing a the day of the week

Method Details

cancelBackupSchedule() public method

Cancels an environment's regular backup schedule

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

fetch() public method

Fetches model data from API and instantiates its model instances
public fetch ( array $options = [] ) : TerminusCollection
$options array params to pass configure fetching array $data Data to fill in the model members of this collection
return TerminusCollection $this

getBackupByFileName() public method

Fetches backup for a specified filename
public getBackupByFileName ( string $filename ) : Backup
$filename string Name of the file name to filter by
return Backup

getBackupSchedule() public method

Retrieves an environment's regular backup schedule
public getBackupSchedule ( ) : array
return array $schedule Elements as follows: - daily_backup_time: string - weekly_backup_day: string

getBackupsByElement() public method

Lists all backups for a specific element.
public getBackupsByElement ( string $element = null ) : Backup[]
$element string Name of the element type to filter by
return Backup[]

getDayNumber() protected method

Retrieve an integer representing a the day of the week
protected getDayNumber ( string $day ) : integer
$day string The day of the week
return integer 0 = Sunday, 6 = Saturday

getFinishedBackups() public method

Filters the backups for only ones which have finished
public getFinishedBackups ( string $element = null ) : Backup[]
$element string Element requested (i.e. code, db, or files)
return Backup[] An array of Backup objects

getValidElements() public method

Valid backup types
public getValidElements ( ) : string[]
return string[] An array of valid elements

setBackupSchedule() public method

Sets an environment's regular backup schedule
public setBackupSchedule ( array $options = ['day' => null, 'hour' => null] ) : Workflow
$options array Elements as follow: string day A day of the week integer hour Hour of the day to run the backups at, 0 = 00:00 23 = 23:00
return Workflow

Property Details

$collected_class protected_oe property

protected string $collected_class
return string

$url protected_oe property

protected string $url
return string