コード例 #1
0
 public function get(WebhookEvent $event)
 {
     switch ($event->getType()) {
         case WebhookEvent::FEED_ENTRY_TYPE:
             return new FeedEntryProcessor($event, $this->app);
             break;
         default:
             throw new \RuntimeException(sprintf('No processor found for %s', $event->getType()));
     }
 }
コード例 #2
0
 public function get(WebhookEvent $event)
 {
     switch ($event->getType()) {
         case WebhookEvent::FEED_ENTRY_TYPE:
             return new FeedEntryProcessor($this->app, $this->app['repo.feed-entries'], $this->app['phraseanet.user-query']);
         case WebhookEvent::USER_REGISTRATION_TYPE:
             return new UserRegistrationProcessor($this->app['repo.users']);
         default:
             throw new \RuntimeException(sprintf('No processor found for %s', $event->getType()));
     }
 }