Exemplo n.º 1
0
 public function test()
 {
     $feeds = [$this->getMock('Drupal\\feeds\\FeedInterface')];
     $event = new DeleteFeedsEvent($feeds);
     $this->assertSame($feeds, $event->getFeeds());
 }
Exemplo n.º 2
0
 /**
  * Deletes subscriptions when feeds are deleted.
  */
 public function onDeleteMultipleFeeds(DeleteFeedsEvent $event)
 {
     $subscriptions = $this->storage->loadMultiple(array_keys($event->getFeeds()));
     foreach ($event->getFeeds() as $feed) {
         if (!isset($subscriptions[$feed->id()])) {
             continue;
         }
         $this->unsubscribe($feed, $subscriptions[$feed->id()]);
     }
 }