protected function initContexts()
    {
        if (empty($this->contexts)) {
            throw new CException('PaymentManager.contexts cannot be empty.');
        }
        foreach ($this->contexts as $name => $config) {
            if (!isset($config['class'])) {
                $config['class'] = 'PaymentContext';
            }
            if (!isset($config['name'])) {
                $config['name'] = $name;
            }
            $context = Yii::createComponent($config);
            if (!($context instanceof PaymentContext)) {
                throw new CException('Payment context must be an instance of PaymentContext.');
            }
            $this->_contexts[$name] = $context;
        }
    }
protected function initContexts()
    {
        if (empty($this->contexts)) {
            throw new CException('PaymentManager.contexts cannot be empty.');
        }
        foreach ($this->contexts as $name => $config) {
            if (!isset($config['class'])) {
                $config['class'] = 'PaymentContext';
            }
            if (!isset($config['name'])) {
                $config['name'] = $name;
            }
            $context = Yii::createComponent($config);
            if (!($context instanceof PaymentContext)) {
                throw new CException('Payment context must be an instance of PaymentContext.');
            }
            $this->_contexts[$name] = $context;
        }
    }
protected function initContexts ( ) { if ( empty ( $ this -> contexts ) ) { throw new CException ( 'PaymentManager.contexts cannot be empty.' ) ; } foreach ( $ this -> contexts as $ name => $ config ) { if ( ! isset ( $ config [ 'class' ] ) ) { $ config [ 'class' ] = 'PaymentContext' ; } if ( ! isset ( $ config [ 'name' ] ) ) { $ config [ 'name' ] = $ name ; } $ context = Yii :: createComponent ( $ config ) ; if ( ! ( $ context instanceof PaymentContext ) ) { throw new CException ( 'Payment context must be an instance of PaymentContext.' ) ; } $ this -> _contexts [ $ name ] = $ context ; } }
Creates the payment context components from the configuration.
@throws CException if context config is empty or context cannot be created.
Creates the payment context components from the configuration .