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);
    }