NerdsAndCompany\Schematic\Console\App::getComponent PHP Method

getComponent() public method

Override getComponent() so we can attach any pending events if the component is getting initialized as well as do some special logic around creating the Craft::app()->db application component.
public getComponent ( string $id, boolean $createIfNull = true ) : mixed
$id string
$createIfNull boolean
return mixed
    public function getComponent($id, $createIfNull = true)
    {
        $component = parent::getComponent($id, false);
        if (!$component && $createIfNull) {
            if ($id === 'db') {
                $dbConnection = $this->asa('SchematicBehavior')->createDbConnection();
                $this->setComponent('db', $dbConnection);
            }
            $component = parent::getComponent($id, true);
            $this->_attachEventListeners($id);
        }
        return $component;
    }