src/Graviton/SchemaBundle/Constraint/ReadOnlyFieldConstraint.php
private function propertyExists($object, $fieldName)
    {
        if (property_exists($object, $fieldName)) {
            return true;
        }

        foreach (explode('.', $fieldName) as $field) {
            if (property_exists($object, $field)) {
                $object = $object->{$field};
                if (!is_object($object)) {
                    break;
                }
                continue;
            } else {
                return false;
            }
        }
        return true;
    }
private function propertyExists($object, $fieldName)
    {
        if (property_exists($object, $fieldName)) {
            return true;
        }

        foreach (explode('.', $fieldName) as $field) {
            if (property_exists($object, $field)) {
                $object = $object->{$field};
                if (!is_object($object)) {
                    break;
                }
                continue;
            } else {
                return false;
            }
        }
        return true;
    }
private function propertyExists ( $ object , $ fieldName ) { if ( property_exists ( $ object , $ fieldName ) ) { return true ; } foreach ( explode ( '.' , $ fieldName ) as $ field ) { if ( property_exists ( $ object , $ field ) ) { $ object = $ object -> { $ field } ; if ( ! is_object ( $ object ) ) { break ; } continue ; } else { return false ; } } return true ; }
To validate before accessor brakes with not found field

@param object $object    To be parsed
@param string $fieldName Field name, dot chained.
@return bool
To validate before accessor brakes with not found field