protected function getValue($object, $property)
    {
        if (isset($object->{$property})) {
            return $object->{$property};
        }

        $reflectionClass = new ReflectionClass($object);

        if (!$reflectionClass->hasProperty($property)) {
            return null;
        }

        $reflectionProperty = $reflectionClass->getProperty($property);
        $reflectionProperty->setAccessible(true);

        return $reflectionProperty->getValue($object);
    }
protected function getValue($object, $property)
    {
        if (isset($object->{$property})) {
            return $object->{$property};
        }

        $reflectionClass = new ReflectionClass($object);

        if (!$reflectionClass->hasProperty($property)) {
            return null;
        }

        $reflectionProperty = $reflectionClass->getProperty($property);
        $reflectionProperty->setAccessible(true);

        return $reflectionProperty->getValue($object);
    }
protected function getValue ( $ object , $ property ) { if ( isset ( $ object -> { $ property } ) ) { return $ object -> { $ property } ; } $ reflectionClass = new ReflectionClass ( $ object ) ; if ( ! $ reflectionClass -> hasProperty ( $ property ) ) { return null ; } $ reflectionProperty = $ reflectionClass -> getProperty ( $ property ) ; $ reflectionProperty -> setAccessible ( true ) ; return $ reflectionProperty -> getValue ( $ object ) ; }
Gets a value from an object

@param   object $object   The object
@param   string $property The property

@return mixed
Gets a value from an object