Social Feeds provides a collection of events for extending its functionality. Modules and plugins can register event listeners, typically in their init()
methods, to modify Social Feeds’s behavior.
beforeSaveFeed
event#The event that is triggered before a feed is saved.
use verbb\socialfeeds\events\FeedEvent;
use verbb\socialfeeds\services\Feeds;
use yii\base\Event;
Event::on(Feeds::class, Feeds::EVENT_BEFORE_SAVE_FEED, function(FeedEvent $event) {
$feed = $event->feed;
$isNew = $event->isNew;
// ...
});
afterSaveFeed
event#The event that is triggered after a feed is saved.
use verbb\socialfeeds\events\FeedEvent;
use verbb\socialfeeds\services\Feeds;
use yii\base\Event;
Event::on(Feeds::class, Feeds::EVENT_AFTER_SAVE_FEED, function(FeedEvent $event) {
$feed = $event->feed;
$isNew = $event->isNew;
// ...
});
beforeDeleteFeed
event#The event that is triggered before a feed is deleted.
use verbb\socialfeeds\events\FeedEvent;
use verbb\socialfeeds\services\Feeds;
use yii\base\Event;
Event::on(Feeds::class, Feeds::EVENT_BEFORE_DELETE_FEED, function(FeedEvent $event) {
$feed = $event->feed;
// ...
});
afterDeleteFeed
event#The event that is triggered after a feed is deleted.
use verbb\socialfeeds\events\FeedEvent;
use verbb\socialfeeds\services\Feeds;
use yii\base\Event;
Event::on(Feeds::class, Feeds::EVENT_AFTER_DELETE_FEED, function(FeedEvent $event) {
$feed = $event->feed;
// ...
});
beforeSaveSource
event#The event that is triggered before a source is saved.
use verbb\socialfeeds\events\SourceEvent;
use verbb\socialfeeds\services\Sources;
use yii\base\Event;
Event::on(Sources::class, Sources::EVENT_BEFORE_SAVE_SOURCE, function(SourceEvent $event) {
$source = $event->source;
$isNew = $event->isNew;
// ...
});
afterSaveSource
event#The event that is triggered after a source is saved.
use verbb\socialfeeds\events\SourceEvent;
use verbb\socialfeeds\services\Sources;
use yii\base\Event;
Event::on(Sources::class, Sources::EVENT_AFTER_SAVE_SOURCE, function(SourceEvent $event) {
$source = $event->source;
$isNew = $event->isNew;
// ...
});
beforeDeleteSource
event#The event that is triggered before a source is deleted.
use verbb\socialfeeds\events\SourceEvent;
use verbb\socialfeeds\services\Sources;
use yii\base\Event;
Event::on(Sources::class, Sources::EVENT_BEFORE_DELETE_SOURCE, function(SourceEvent $event) {
$source = $event->source;
// ...
});
afterDeleteSource
event#The event that is triggered after a source is deleted.
use verbb\socialfeeds\events\SourceEvent;
use verbb\socialfeeds\services\Sources;
use yii\base\Event;
Event::on(Sources::class, Sources::EVENT_AFTER_DELETE_SOURCE, function(SourceEvent $event) {
$source = $event->source;
// ...
});