Pantheon\Terminus\Commands\Workflow\Info\InfoBaseCommand::getWorkflow PHP Method

getWorkflow() protected method

Get the Workflow object
protected getWorkflow ( string $site_id, string $workflow_id = null ) : Workflow
$site_id string UUID or name of the site to get a workflow of
$workflow_id string The UUID of a specific workflow to retrieve
return Workflow
    protected function getWorkflow($site_id, $workflow_id = null)
    {
        $site = $this->getSite($site_id);
        $workflows = $site->getWorkflows()->fetch(['paged' => false])->all();
        if (!is_null($workflow_id)) {
            $workflow = $site->getWorkflows()->get($workflow_id);
        } else {
            $workflow = array_shift($workflows);
            $this->log()->notice('Showing latest workflow on {site}.', ['site' => $site_id]);
        }
        $workflow->fetchWithLogs();
        return $workflow;
    }
InfoBaseCommand