protected function extractName(ModelStubInterface $model, $name)
    {
        if ($model->getObjectPrototype() instanceof HydratorAwareInterface) {
            $objectHydrator = $model->getObjectPrototype()->getHydrator();
            
            if (!$objectHydrator || !method_exists($objectHydrator, 'hydrateName')) {
                throw new Exception\RuntimeException(
                    'Object hydrator must be set and must have hydrateName() ' .
                    'in order to convert a single field'
                    );
            }
            $name = $objectHydrator->hydrateName($name);
        }

        $modelHydrator = $model->getHydrator();
        if (!$modelHydrator || !method_exists($modelHydrator, 'extractName')) {
            throw new Exception\RuntimeException(
                'Model hydrator must be set and must have extractName() method ' .
                'in order to convert a single field'
                );
        }
        
        return $modelHydrator->extractName($name);
    }
protected function extractName(ModelStubInterface $model, $name)
    {
        if ($model->getObjectPrototype() instanceof HydratorAwareInterface) {
            $objectHydrator = $model->getObjectPrototype()->getHydrator();
            
            if (!$objectHydrator || !method_exists($objectHydrator, 'hydrateName')) {
                throw new Exception\RuntimeException(
                    'Object hydrator must be set and must have hydrateName() ' .
                    'in order to convert a single field'
                    );
            }
            $name = $objectHydrator->hydrateName($name);
        }

        $modelHydrator = $model->getHydrator();
        if (!$modelHydrator || !method_exists($modelHydrator, 'extractName')) {
            throw new Exception\RuntimeException(
                'Model hydrator must be set and must have extractName() method ' .
                'in order to convert a single field'
                );
        }
        
        return $modelHydrator->extractName($name);
    }
protected function extractName ( ModelStubInterface $ model , $ name ) { if ( $ model -> getObjectPrototype ( ) instanceof HydratorAwareInterface ) { $ objectHydrator = $ model -> getObjectPrototype ( ) -> getHydrator ( ) ; if ( ! $ objectHydrator || ! method_exists ( $ objectHydrator , 'hydrateName' ) ) { throw new Exception \ RuntimeException ( 'Object hydrator must be set and must have hydrateName() ' . 'in order to convert a single field' ) ; } $ name = $ objectHydrator -> hydrateName ( $ name ) ; } $ modelHydrator = $ model -> getHydrator ( ) ; if ( ! $ modelHydrator || ! method_exists ( $ modelHydrator , 'extractName' ) ) { throw new Exception \ RuntimeException ( 'Model hydrator must be set and must have extractName() method ' . 'in order to convert a single field' ) ; } return $ modelHydrator -> extractName ( $ name ) ; }
Extract a name in order to be used within datagateway context

If an object's hydrator is avaliable, then $name will be converted to
a model name using the object's hydrator naming strategy.
Finally, $name will be extracted using the model's hydrator naming
strategy.

@param ModelStubInterface $model
@param string $name
@throws Exception\RuntimeException
@return string
Extract a name in order to be used within datagateway context