Pantheon\Terminus\Commands\Tag\ListCommand::listTags PHP Method

listTags() public method

List the tags which an organization has added to a site
public listTags ( string $site_name, string $organization ) : Consolidation\OutputFormatters\StructuredData\PropertyList
$site_name string The name or UUID of a site to list the tags of
$organization string The name or UUID of an organization which has tagged this site
return Consolidation\OutputFormatters\StructuredData\PropertyList
    public function listTags($site_name, $organization)
    {
        $org = $this->session()->getUser()->getOrgMemberships()->get($organization)->getOrganization();
        $site = $org->getSiteMemberships()->get($site_name)->getSite();
        $tags = $site->tags->ids();
        if (empty($tags)) {
            $this->log()->notice('{org} does not have any tags for {site}.', ['org' => $org->get('profile')->name, 'site' => $site->get('name')]);
        }
        return new PropertyList($tags);
    }
ListCommand