AlexaCRM / dynamics-webapi-toolkit

Dynamics 365 Web API Toolkit for PHP
MIT License
75 stars 58 forks source link

Add support for multiple operators as json #91

Open mrfroasty opened 1 year ago

mrfroasty commented 1 year ago

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 )
georged commented 1 year ago

@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.