PHP Class Pantheon\Terminus\Models\Workflow

Inheritance: extends TerminusModel, implements League\Container\ContainerAwareInterface, implements Pantheon\Terminus\Session\SessionAwareInterface, use trait League\Container\ContainerAwareTrait, use trait Pantheon\Terminus\Session\SessionAwareTrait
显示文件 Open project: pantheon-systems/terminus Class Usage Examples

Protected Properties

Property Type Description
$owner mixed

Public Methods

Method Description
__construct ( object $attributes = null, array $options = [] ) : Workflow Object constructor
checkProgress ( ) : boolean Check on the progress of a workflow. This can be called repeatedly and will apply a polling period to prevent flooding the API with requests.
fetchWithLogs ( ) : Workflow Re-fetches workflow data hydrated with logs
getMessage ( ) : string Get the success message of a workflow or throw an exception of the workflow failed.
getStatus ( ) : string Returns the status of this workflow
getUrl ( ) : string Get the URL for this model
isFinished ( ) : boolean Detects if the workflow has finished
isSuccessful ( ) : boolean Detects if the workflow was successful
operations ( ) : WorkflowOperation[] Returns a list of WorkflowOperations for this workflow
serialize ( ) : array Formats workflow object into an associative array for output
wait ( ) : Workflow | void Waits on this workflow to finish

Private Methods

Method Description
poll ( ) : void Fetches this object from Pantheon. Waits a given length of time between checks.

Method Details

__construct() public method

Object constructor
public __construct ( object $attributes = null, array $options = [] ) : Workflow
$attributes object Attributes of this model
$options array Options with which to configure this model
return Workflow

checkProgress() public method

Check on the progress of a workflow. This can be called repeatedly and will apply a polling period to prevent flooding the API with requests.
public checkProgress ( ) : boolean
return boolean Whether the workflow is finished or not

fetchWithLogs() public method

Re-fetches workflow data hydrated with logs
public fetchWithLogs ( ) : Workflow
return Workflow

getMessage() public method

Get the success message of a workflow or throw an exception of the workflow failed.
public getMessage ( ) : string
return string The message to output to the user

getStatus() public method

Returns the status of this workflow
public getStatus ( ) : string
return string

getUrl() public method

Get the URL for this model
public getUrl ( ) : string
return string

isFinished() public method

Detects if the workflow has finished
public isFinished ( ) : boolean
return boolean True if workflow has finished

isSuccessful() public method

Detects if the workflow was successful
public isSuccessful ( ) : boolean
return boolean True if workflow succeeded

operations() public method

Returns a list of WorkflowOperations for this workflow
public operations ( ) : WorkflowOperation[]
return WorkflowOperation[]

serialize() public method

Formats workflow object into an associative array for output
public serialize ( ) : array
return array Associative array of data for output

wait() public method

Waits on this workflow to finish
public wait ( ) : Workflow | void
return Workflow | void

Property Details

$owner protected_oe property

protected mixed $owner
return mixed