src/Entity/Hydrator/EntityHydrator.php
public function extract($object)
    {
        if (!$object instanceof EntityInterface) {
            return array();
            //@todo Error-Handling
        }
        
        $getters = array_filter(
            get_class_methods($object),
            function ($methodName) use ($object) {
                return "get" === substr($methodName, 0, 3)
                && method_exists($object, 's' . substr($methodName, 1));
            }
        );

        $data = array();
        foreach ($getters as $getter) {
            $propertyValue = $object->$getter();
            $propertyName = lcfirst(substr($getter, 3));
            if ($this->getFilter()->filter($propertyName)) {
                $data[$propertyName] = $this->extractValue($propertyName, $propertyValue, $object);
            }
        }
        return $data;
    }
public function extract($object)
    {
        if (!$object instanceof EntityInterface) {
            return array();
            //@todo Error-Handling
        }
        
        $getters = array_filter(
            get_class_methods($object),
            function ($methodName) use ($object) {
                return "get" === substr($methodName, 0, 3)
                && method_exists($object, 's' . substr($methodName, 1));
            }
        );

        $data = array();
        foreach ($getters as $getter) {
            $propertyValue = $object->$getter();
            $propertyName = lcfirst(substr($getter, 3));
            if ($this->getFilter()->filter($propertyName)) {
                $data[$propertyName] = $this->extractValue($propertyName, $propertyValue, $object);
            }
        }
        return $data;
    }
public function extract ( $ object ) { if ( ! $ object instanceof EntityInterface ) { return array ( ) ; //@todo Error-Handling } $ getters = array_filter ( get_class_methods ( $ object ) , function ( $ methodName ) use ( $ object ) { return "get" === substr ( $ methodName , 0 , 3 ) && method_exists ( $ object , 's' . substr ( $ methodName , 1 ) ) ; } ) ; $ data = array ( ) ; foreach ( $ getters as $ getter ) { $ propertyValue = $ object -> $ getter ( ) ; $ propertyName = lcfirst ( substr ( $ getter , 3 ) ) ; if ( $ this -> getFilter ( ) -> filter ( $ propertyName ) ) { $ data [ $ propertyName ] = $ this -> extractValue ( $ propertyName , $ propertyValue , $ object ) ; } } return $ data ; }
/* (non-PHPdoc)
@see \Zend\Hydrator\HydratorInterface::extract()
/ * ( non - PHPdoc )