Pantheon\Terminus\Models\Workflow::getUrl PHP Method

getUrl() public method

Get the URL for this model
public getUrl ( ) : string
return string
    public function getUrl()
    {
        if (!empty($this->url)) {
            return $this->url;
        }
        // Determine the url based on the workflow owner.
        switch (get_class($this->owner)) {
            case 'Pantheon\\Terminus\\Models\\Environment':
                $this->environment = $this->owner;
                $this->url = sprintf('sites/%s/workflows/%s', $this->environment->site->id, $this->id);
                break;
            case 'Pantheon\\Terminus\\Models\\Organization':
                $this->organization = $this->owner;
                $this->url = sprintf('users/%s/organizations/%s/workflows/%s', $this->session()->getUser()->id, $this->organization->id, $this->id);
                break;
            case 'Pantheon\\Terminus\\Models\\Site':
                $this->site = $this->owner;
                $this->url = sprintf('sites/%s/workflows/%s', $this->site->id, $this->id);
                break;
            case 'Pantheon\\Terminus\\Models\\User':
                $this->user = $this->owner;
                $this->url = sprintf('users/%s/workflows/%s', $this->user->id, $this->id);
                break;
        }
        return $this->url;
    }