Pantheon\Terminus\Commands\Org\Site\ListCommand::listSites PHP Method

listSites() public method

List the sites belonging to a given organization
public listSites ( string $organization, $options = ['tag' => null] ) : Consolidation\OutputFormatters\StructuredData\RowsOfFields
$organization string The name or UUID of the organization to list the sites of
return Consolidation\OutputFormatters\StructuredData\RowsOfFields
    public function listSites($organization, $options = ['tag' => null])
    {
        $org = $this->session()->getUser()->getOrgMemberships()->get($organization)->getOrganization();
        $this->sites->fetch(['org_id' => $org->id]);
        if (!is_null($tag = $options['tag'])) {
            $this->sites->filterByTag($tag);
        }
        $sites = array_map(function ($site) {
            return $site->serialize();
        }, $this->sites->all());
        if (empty($sites)) {
            $this->log()->notice('This organization has no sites.');
        }
        return new RowsOfFields($sites);
    }
ListCommand