Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make site label available to site:list and org:site:list commands #2071

Open
wants to merge 3 commits into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Collections/Sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ public function filterByName($regex = '(.*)')
return $this->filterByRegex('name', $regex);
}

/**
* Filters the members of this collection by their labels
*
* @param string $regex Non-delimited PHP regex to filter site names by
* @return Sites
*/
public function filterByLabel($regex = '(.*)')
{
return $this->filterByRegex('label', $regex);
}

/**
* Filters an array of sites by the plan name
*
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/Org/Site/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ class ListCommand extends TerminusCommand implements SiteAwareInterface
*
* @field-labels
* name: Name
* label: Label
* id: ID
* plan_name: Plan
* framework: Framework
* owner: Owner
* created: Created
* tags: Tags
* frozen: Is Frozen?
* @default-fields name,id,plan_name,framework,owner,created,tags,frozen
* @return RowsOfFields
*
* @param string $organization Organization name, label, or ID
Expand Down
1 change: 1 addition & 0 deletions src/Commands/Site/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ListCommand extends SiteCommand
*
* @field-labels
* name: Name
* label: Label
* id: ID
* plan_name: Plan
* framework: Framework
Expand Down