private function resolveProfilePictureField(ApiUser $user): ?Field
    {
        $contentType = $user->getContentType();
        foreach ($user->getFields() as $field) {
            $fieldDef = $contentType->getFieldDefinition($field->fieldDefIdentifier);

            if ('ezimage' === $fieldDef->fieldTypeIdentifier) {
                return $field;
            }
        }

        return null;
    }
private function resolveProfilePictureField(ApiUser $user): ?Field
    {
        $contentType = $user->getContentType();
        foreach ($user->getFields() as $field) {
            $fieldDef = $contentType->getFieldDefinition($field->fieldDefIdentifier);

            if ('ezimage' === $fieldDef->fieldTypeIdentifier) {
                return $field;
            }
        }

        return null;
    }
private function resolveProfilePictureField ( ApiUser $ user ) : ? Field { $ contentType = $ user -> getContentType ( ) ; foreach ( $ user -> getFields ( ) as $ field ) { $ fieldDef = $ contentType -> getFieldDefinition ( $ field -> fieldDefIdentifier ) ; if ( 'ezimage' === $ fieldDef -> fieldTypeIdentifier ) { return $ field ; } } return null ; }
Returns first occurrence of an `ezimage` fieldtype.

@param ApiUser $user

@return Field|null
Returns first occurrence of an ezimage fieldtype .