gomoob / php-pushwoosh

A PHP Library to easily send push notifications with the Pushwoosh REST Web Services.
http://gomoob.github.io/php-pushwoosh
MIT License
65 stars 37 forks source link

Implement powerful DSL for targeted message filters #43

Open bgaillard opened 8 years ago

bgaillard commented 8 years ago

For now the TargetedMessageRequest allows to set a devicesFilter property as a string only.

It would be great to have a powerful DSL to create the device filters, for example.

$filters = StringTagFilter::create('username')->eq('my_username')->and(IntTagFilter::create('age')->between(15, 50))->join(ApplicationTagFilter::create('XXXXX-XXXXX');

This sample will be equivalent to (T("username", EQ, "my_username"), T("favorite_color", IN, ["red","green","blue"])) + A('XXXXX-XXXXX).

A first implementation has been started on the devices-filter branch.