PHP Class Pantheon\Terminus\Collections\Sites

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

Protected Properties

Property Type Description
$collected_class string

Public Methods

Method Description
__construct ( array $options = [] ) : Sites Instantiates the collection, sets param members as properties
all ( ) : Site[] Retrieves all sites
create ( string[] $params = [] ) : Workflow Creates a new site
createForMigration ( string[] $params = [] ) : Workflow Creates a new site for migration
fetch ( array $arg_options = [] ) : Sites Fetches model data from API and instantiates its model instances
filterByName ( string $regex = '(.*)' ) : Sites Filters an array of sites by whether the user is an organizational member
filterByOwner ( string $owner_uuid ) : Sites Filters an array of sites by whether the user is an organizational member
filterByTag ( string $tag ) : Sites Filters sites list by tag
findUuidByName ( string $name ) : string Looks up a site's UUID by its name.
get ( string $id ) : Site Retrieves the site of the given UUID or name
nameIsTaken ( string $name ) : boolean Determines whether a given site name is taken or not.

Method Details

__construct() public method

Instantiates the collection, sets param members as properties
public __construct ( array $options = [] ) : Sites
$options array To be set to $this->key
return Sites

all() public method

Retrieves all sites
public all ( ) : Site[]
return Site[]

create() public method

Creates a new site
public create ( string[] $params = [] ) : Workflow
$params string[] Options for the new site, elements as follow: string label The site's human-friendly name string site_name The site's name string organization_id Organization to which this site belongs' UUID
return Workflow

createForMigration() public method

Creates a new site for migration
public createForMigration ( string[] $params = [] ) : Workflow
$params string[] Options for the new site, elements as follow: string label The site's human-friendly name string site_name The site's name string organization_id Organization to which this site belongs' UUID string type Workflow type for imports
return Workflow

fetch() public method

Fetches model data from API and instantiates its model instances
public fetch ( array $arg_options = [] ) : Sites
$arg_options array Options to change the requests made. Elements as follow: string org_id UUID of the organization to retrieve sites for boolean team_only True to only retrieve team sites
return Sites

filterByName() public method

Filters an array of sites by whether the user is an organizational member
public filterByName ( string $regex = '(.*)' ) : Sites
$regex string Non-delimited PHP regex to filter site names by
return Sites

filterByOwner() public method

Filters an array of sites by whether the user is an organizational member
public filterByOwner ( string $owner_uuid ) : Sites
$owner_uuid string UUID of the owning user to filter by
return Sites

filterByTag() public method

Filters sites list by tag
public filterByTag ( string $tag ) : Sites
$tag string A tag to filter by
return Sites

findUuidByName() public method

Looks up a site's UUID by its name.
public findUuidByName ( string $name ) : string
$name string Name of the site to look up
return string

get() public method

Retrieves the site of the given UUID or name
public get ( string $id ) : Site
$id string UUID or name of desired site
return Site

nameIsTaken() public method

Determines whether a given site name is taken or not.
public nameIsTaken ( string $name ) : boolean
$name string Name of the site to look up
return boolean

Property Details

$collected_class protected_oe property

protected string $collected_class
return string