Exemplo n.º 1
0
 /**
  * Injects a shared event manager aware event manager.
  *
  *
  * @param AssertionInterface      $assertion
  * @param ServiceLocatorInterface $serviceLocator
  */
 public function injectEventManager(AssertionInterface $assertion, ServiceLocatorInterface $serviceLocator)
 {
     /* @var $serviceLocator AssertionManager */
     if (!$assertion instanceof EventManagerAwareInterface) {
         return;
     }
     $parentLocator = $serviceLocator->getServiceLocator();
     $events = $assertion->getEventManager();
     if (!$events instanceof EventManagerInterface) {
         $events = $parentLocator->get('EventManager');
         /* @var $events \Zend\EventManager\EventManagerInterface */
         $assertion->setEventManager($events);
     } else {
         $sharedEvents = $parentLocator->get('SharedEventManager');
         /* @var $sharedEvents \Zend\EventManager\SharedEventManagerInterface */
         $events->setSharedManager($sharedEvents);
     }
 }
Exemplo n.º 2
0
 public function assert(Acl $acl, RoleInterface $role = null, ResourceInterface $resource = null, $privilege = null)
 {
     return !$this->baseAssertion->assert($acl, $role, $resource, $privilege);
 }