Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple operators as json #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrfroasty
Copy link

@mrfroasty mrfroasty commented Feb 13, 2023

One can use inputs then like this :

        $jsonDate = json_encode(
            [
                'value' => $syncDate->format('Y-m-d\TH:i:s\Z'),
                'operator' => 'gt'
            ],
            JSON_THROW_ON_ERROR
        );
$query = new QueryByAttribute($entityName);
$query->AddAttributeValue( 'field-code', jsonDate )

One can use inputs then like this : 
        $jsonDate = json_encode(
            [
                'value' => $syncDate->format('Y-m-d\TH:i:s\Z'),
                'operator' => 'gt'
            ],
            JSON_THROW_ON_ERROR
        );
$query = new QueryByAttribute($entityName);
$query->AddAttributeValue( 'field-code', jsonDate )
Copy link
Author

@mrfroasty mrfroasty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is backward compatible

@georged
Copy link
Contributor

georged commented Feb 14, 2023

@mrfroasty thanks for the pull request. It does look interesting and useful as an enhancement but it'd be better off implemented using a separate code path. Reason is that our classes including QueryByAttribute are modelled based on Dataverse SDK. In this case the .NET class is documented here. As you can see, it only supports equal operator. It's a simplified case of QueryExpression that can be used if more complex expressions are required.

@georged georged added enhancement New feature or request invalid This doesn't seem right wontfix This will not be worked on labels Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants