protected function getProperty($object, $name)
    {
        $class = new \ReflectionClass($object);
        while (!$class->hasProperty($name)) {
            $class = $class->getParentClass();
        }
        return $class->getProperty($name);
    }
protected function getProperty($object, $name)
    {
        $class = new \ReflectionClass($object);
        while (!$class->hasProperty($name)) {
            $class = $class->getParentClass();
        }
        return $class->getProperty($name);
    }
protected function getProperty ( $ object , $ name ) { $ class = new \ ReflectionClass ( $ object ) ; while ( ! $ class -> hasProperty ( $ name ) ) { $ class = $ class -> getParentClass ( ) ; } return $ class -> getProperty ( $ name ) ; }
Returns the reflected property.

@param object|string $object
@param string $name
@return \ReflectionProperty
Returns the reflected property .