IsraelOrtuno / pipedrive

Complete Pipedrive API client for PHP
MIT License
166 stars 58 forks source link

Proposal: Add event dispatcher #7

Closed dkulyk closed 8 years ago

dkulyk commented 8 years ago

You can add event dispatcher:

$pipedrive->on('update', 'product', function($previous, $current, $meta) {
    //code here...
});
$pipedrive->clients->on('update', function($previous, $current, $meta) {
    //code here...
});
$pipedrive->deals->on('create', function($current, $meta){
    //code here...
});
$pipedrive->dispatch($eventJson);
IsraelOrtuno commented 8 years ago

Humm... Pipedrive also includes Push notifications where you can register and trigger all this events

https://www.youtube.com/watch?v=flhul9gR_Ok

dkulyk commented 8 years ago

Yes. But to make it easier to work with them, you can add an event manager, which will:

IsraelOrtuno commented 8 years ago

Hum... Not really sure about this. Imagine you create an Organization through Pipedrive app, you have to set a push notification for acting on that event when you have also defined an event listener when creating from your app.

dkulyk commented 8 years ago

I can identify one-time event notifications for . \ And dispatch them in the application.

IsraelOrtuno commented 8 years ago

Implementing this will become too complex, this package is intended to simplify the API use :)