PHP Class Pantheon\Terminus\Models\Site

Inheritance: extends TerminusModel, implements Robo\Contract\ConfigAwareInterface, implements League\Container\ContainerAwareInterface, use trait Robo\Common\ConfigAwareTrait, use trait League\Container\ContainerAwareTrait
Mostra file Open project: pantheon-systems/terminus Class Usage Examples

Public Properties

Property Type Description
$branches Pantheon\Terminus\Collections\Branches
$environments Pantheon\Terminus\Collections\Environments
$new_relic NewRelic
$org_memberships Pantheon\Terminus\Collections\SiteOrganizationMemberships
$redis Redis
$solr Solr
$user_memberships Pantheon\Terminus\Collections\SiteUserMemberships
$workflows Pantheon\Terminus\Collections\Workflows

Protected Properties

Property Type Description
$upstream_data stdClass
$url The URL at which to fetch this model's information

Public Methods

Method Description
__construct ( $attributes = null, array $options = [] )
addPaymentMethod ( string $payment_method_id ) : Workflow Add a payment method to the given site
completeMigration ( ) : Workflow Completes a site migration in progress
converge ( ) : Workflow Converges all bindings on a site
dashboardUrl ( ) : string Provides Pantheon Dashboard URL for this site
delete ( ) : Workflow Deletes the site represented by this object
deployProduct ( string $upstream_id ) : Workflow Creates a new site for migration
fetch ( array $options = [] ) : Site Fetches this object from Pantheon
getBranches ( ) : Branches
getEnvironments ( ) : Environments
getFeature ( string $feature ) : mixed | null Returns a specific site feature value
getName ( ) : mixed Get the human-readable name of the site
getNewRelic ( ) : NewRelic
getOrganizationMemberships ( ) : SiteOrganizationMemberships
getOrganizations ( ) : SiteOrganizationMembership[] Returns all organization members of this site
getRedis ( ) : Redis
getSolr ( ) : Solr
getUpstream ( ) : Upstream
getUserMemberships ( ) : SiteUserMemberships
getWorkflows ( ) : Workflows
removePaymentMethod ( ) : Workflow Remove this site's payment method
serialize ( ) : array Formats the Site object into an associative array for output
setOwner ( User $user_id ) : Workflow Sets the site owner to the indicated team member
updateServiceLevel ( string $service_level ) : Workflow Update service level

Protected Methods

Method Description
parseAttributes ( object $data ) : object Modify response data between fetch and assignment

Private Methods

Method Description
setUpstream ( object $attributes ) Ensures the proper creation of an Upstream object

Method Details

__construct() public method

public __construct ( $attributes = null, array $options = [] )
$options array

addPaymentMethod() public method

Add a payment method to the given site
public addPaymentMethod ( string $payment_method_id ) : Workflow
$payment_method_id string UUID of new payment method
return Workflow

completeMigration() public method

Completes a site migration in progress
public completeMigration ( ) : Workflow
return Workflow

converge() public method

Converges all bindings on a site
public converge ( ) : Workflow
return Workflow

dashboardUrl() public method

Provides Pantheon Dashboard URL for this site
public dashboardUrl ( ) : string
return string

delete() public method

Deletes the site represented by this object
public delete ( ) : Workflow
return Workflow

deployProduct() public method

Creates a new site for migration
public deployProduct ( string $upstream_id ) : Workflow
$upstream_id string The UUID for the product to deploy.
return Workflow

fetch() public method

Fetches this object from Pantheon
public fetch ( array $options = [] ) : Site
$options array params to pass to url request
return Site

getBranches() public method

public getBranches ( ) : Branches
return Pantheon\Terminus\Collections\Branches

getEnvironments() public method

public getEnvironments ( ) : Environments
return Pantheon\Terminus\Collections\Environments

getFeature() public method

Returns a specific site feature value
public getFeature ( string $feature ) : mixed | null
$feature string Feature to check
return mixed | null Feature value, or null if not found

getName() public method

Get the human-readable name of the site
public getName ( ) : mixed
return mixed

getNewRelic() public method

public getNewRelic ( ) : NewRelic
return NewRelic

getOrganizationMemberships() public method

public getOrganizationMemberships ( ) : SiteOrganizationMemberships
return Pantheon\Terminus\Collections\SiteOrganizationMemberships

getOrganizations() public method

Returns all organization members of this site
public getOrganizations ( ) : SiteOrganizationMembership[]
return SiteOrganizationMembership[]

getRedis() public method

public getRedis ( ) : Redis
return Redis

getSolr() public method

public getSolr ( ) : Solr
return Solr

getUpstream() public method

public getUpstream ( ) : Upstream
return Upstream

getUserMemberships() public method

public getUserMemberships ( ) : SiteUserMemberships
return Pantheon\Terminus\Collections\SiteUserMemberships

getWorkflows() public method

public getWorkflows ( ) : Workflows
return Pantheon\Terminus\Collections\Workflows

parseAttributes() protected method

Modify response data between fetch and assignment
protected parseAttributes ( object $data ) : object
$data object attributes received from API response
return object $data

removePaymentMethod() public method

Remove this site's payment method
public removePaymentMethod ( ) : Workflow
return Workflow

serialize() public method

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

setOwner() public method

Sets the site owner to the indicated team member
public setOwner ( User $user_id ) : Workflow
$user_id User UUID of new owner of site
return Workflow

updateServiceLevel() public method

Update service level
public updateServiceLevel ( string $service_level ) : Workflow
$service_level string Level to set service on site to
return Workflow

Property Details

$branches public_oe property

public Branches,Pantheon\Terminus\Collections $branches
return Pantheon\Terminus\Collections\Branches

$environments public_oe property

public Environments,Pantheon\Terminus\Collections $environments
return Pantheon\Terminus\Collections\Environments

$new_relic public_oe property

public NewRelic,Pantheon\Terminus\Models $new_relic
return NewRelic

$org_memberships public_oe property

public SiteOrganizationMemberships,Pantheon\Terminus\Collections $org_memberships
return Pantheon\Terminus\Collections\SiteOrganizationMemberships

$redis public_oe property

public Redis,Pantheon\Terminus\Models $redis
return Redis

$solr public_oe property

public Solr,Pantheon\Terminus\Models $solr
return Solr

$upstream_data protected_oe property

protected stdClass $upstream_data
return stdClass

$url protected_oe property

The URL at which to fetch this model's information
protected $url

$user_memberships public_oe property

public SiteUserMemberships,Pantheon\Terminus\Collections $user_memberships
return Pantheon\Terminus\Collections\SiteUserMemberships

$workflows public_oe property

public Workflows,Pantheon\Terminus\Collections $workflows
return Pantheon\Terminus\Collections\Workflows