protected function createComponent($interface, $config = [], $injectDb = true) {
        if (!isset($this->componentsConfig[$interface])) {
            $message = sprintf('Suitable component for interface "%s" not configured in "%s"', $interface, __CLASS__);
            throw new InvalidConfigException($message);
        }
        $className = $this->componentsConfig[$interface];
        $_config = is_array($className) ? $className : ['class' => $className];
        $_config = ArrayHelper::merge($_config, $config);
        if ($injectDb) {
            $_config = ArrayHelper::merge(['db' => $this], $_config);
        }
        return \Reaction::create($_config);
    }
protected function createComponent($interface, $config = [], $injectDb = true) {
        if (!isset($this->componentsConfig[$interface])) {
            $message = sprintf('Suitable component for interface "%s" not configured in "%s"', $interface, __CLASS__);
            throw new InvalidConfigException($message);
        }
        $className = $this->componentsConfig[$interface];
        $_config = is_array($className) ? $className : ['class' => $className];
        $_config = ArrayHelper::merge($_config, $config);
        if ($injectDb) {
            $_config = ArrayHelper::merge(['db' => $this], $_config);
        }
        return \Reaction::create($_config);
    }
protected function createComponent ( $ interface , $ config = [ ] , $ injectDb = true ) { if ( ! isset ( $ this -> componentsConfig [ $ interface ] ) ) { $ message = sprintf ( 'Suitable component for interface "%s" not configured in "%s"' , $ interface , __CLASS__ ) ; throw new InvalidConfigException ( $ message ) ; } $ className = $ this -> componentsConfig [ $ interface ] ; $ _config = is_array ( $ className ) ? $ className : [ 'class' => $ className ] ; $ _config = ArrayHelper :: merge ( $ _config , $ config ) ; if ( $ injectDb ) { $ _config = ArrayHelper :: merge ( [ 'db' => $ this ] , $ _config ) ; } return \ Reaction :: create ( $ _config ) ; }
Create inner component
@param string $interface
@param array  $config
@param bool   $injectDb
@return QueryBuilderInterface|SchemaInterface|CommandInterface|ColumnSchemaInterface|ConnectionInterface|TransactionInterface
@throws null
Create inner component