Exemplo n.º 1
0
 /**
  * Register a hook subscriber bundle.
  *
  * @param SubscriberBundle $bundle HookBundle.
  *
  * @return AbstractContainer
  */
 public function registerHookSubscriberBundle(SubscriberBundle $bundle)
 {
     if (array_key_exists($bundle->getArea(), $this->subscriberBundles)) {
         throw new \InvalidArgumentException(sprintf('Area %s is already registered', $bundle->getArea()));
     }
     $this->subscriberBundles[$bundle->getArea()] = $bundle;
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Unregister a subscriber bundle from persistence.
  *
  * @param SubscriberBundle $bundle
  */
 public function unregisterSubscriberBundle(SubscriberBundle $bundle)
 {
     $this->storage->unregisterSubscriberByArea($bundle->getArea());
     $this->reload();
 }