You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I was writing wp-notifications-growling, I noticed that we had left out the Notification property callbacks, out of the chainable functions.
In code, that means this is the norm:
The same actually counts for updating a notification. The current API allows the following:
$new_message = 'This message is obsolete. Please remove this call!';
foreach ($factoryas$notification) {
$notification->setMessage($new_message);
$factory->updateNotification($notification->getId(), $notification);
}
A better approach would be:
$new_message = 'This message is obsolete. Please remove this call!';
foreach ($factoryas$notification) {
$notification->setMessage($new_message)->save();
}
As every notification has a reference to the factory it is assigned to, we can actually achieve this.
Any thoughts on this, @didlix? I mean, we will have to alter the base modules for the frameworks we support (which is only WordPress for the moment).
As I was writing wp-notifications-growling, I noticed that we had left out the Notification property
callbacks
, out of the chainable functions.In code, that means this is the norm:
But in reality, it should have a similarly chainable interface. For instance:
This helps us prevent breaking the chain, and the ease of use.
The text was updated successfully, but these errors were encountered: