public function getOptions(ServiceLocatorInterface $sl, $key, $name = null)
    {
        if ($name === null) {
            $name = $this->getName();
        }

        $options = $sl->get('Configuration');
        $options = $options['doctrine'];
        if ($mappingType = $this->getMappingType()) {
            $options = $options[$mappingType];
        }
        $options = isset($options[$key][$name]) ? $options[$key][$name] : null;

        if (null === $options) {
            throw new RuntimeException(
                sprintf(
                    'Options with name "%s" could not be found in "doctrine.%s".',
                    $name,
                    $key
                )
            );
        }

        $optionsClass = $this->getOptionsClass();

        return new $optionsClass($options);
    }
public function getOptions(ServiceLocatorInterface $sl, $key, $name = null)
    {
        if ($name === null) {
            $name = $this->getName();
        }

        $options = $sl->get('Configuration');
        $options = $options['doctrine'];
        if ($mappingType = $this->getMappingType()) {
            $options = $options[$mappingType];
        }
        $options = isset($options[$key][$name]) ? $options[$key][$name] : null;

        if (null === $options) {
            throw new RuntimeException(
                sprintf(
                    'Options with name "%s" could not be found in "doctrine.%s".',
                    $name,
                    $key
                )
            );
        }

        $optionsClass = $this->getOptionsClass();

        return new $optionsClass($options);
    }
public function getOptions ( ServiceLocatorInterface $ sl , $ key , $ name = null ) { if ( $ name === null ) { $ name = $ this -> getName ( ) ; } $ options = $ sl -> get ( 'Configuration' ) ; $ options = $ options [ 'doctrine' ] ; if ( $ mappingType = $ this -> getMappingType ( ) ) { $ options = $ options [ $ mappingType ] ; } $ options = isset ( $ options [ $ key ] [ $ name ] ) ? $ options [ $ key ] [ $ name ] : null ; if ( null === $ options ) { throw new RuntimeException ( sprintf ( 'Options with name "%s" could not be found in "doctrine.%s".' , $ name , $ key ) ) ; } $ optionsClass = $ this -> getOptionsClass ( ) ; return new $ optionsClass ( $ options ) ; }
Gets options from configuration based on name.

@param  ServiceLocatorInterface      $sl
@param  string                       $key
@param  null|string                  $name
@return \Zend\Stdlib\AbstractOptions
@throws \RuntimeException
Gets options from configuration based on name .