Pantheon\Terminus\Collections\Sites::nameIsTaken PHP Method

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
    public function nameIsTaken($name)
    {
        try {
            $this->findUuidByName($name);
            //If this has not been caught, the name is taken.
            $name_is_taken = true;
        } catch (\Exception $e) {
            $name_is_taken = strpos($e->getMessage(), '404 Not Found') !== false;
        }
        return $name_is_taken;
    }