Loading src/UnicaenAuth/Assertion/AbstractAssertion.php +19 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace UnicaenAuth\Assertion; use BjyAuthorize\Service\Authorize; use UnicaenAuth\Service\Traits\UserContextServiceAwareTrait; use Zend\Mvc\Application; use Zend\Mvc\Controller\Plugin\FlashMessenger; use Zend\Mvc\MvcEvent; use Zend\Permissions\Acl\Acl; use Zend\Permissions\Acl\Assertion\AssertionInterface; Loading Loading @@ -33,6 +34,11 @@ abstract class AbstractAssertion implements AssertionInterface, ServiceLocatorAw */ private $role = false; /** * @var FlashMessenger */ private $fm; /** Loading Loading @@ -293,4 +299,17 @@ abstract class AbstractAssertion implements AssertionInterface, ServiceLocatorAw return $serviceAuthorize; } /** * @return FlashMessenger */ protected function flashMessenger() { if (!$this->fm){ $this->fm = $this->getServiceLocator()->get('controllerpluginmanager')->get('flashmessenger'); } return $this->fm; } } No newline at end of file Loading
src/UnicaenAuth/Assertion/AbstractAssertion.php +19 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace UnicaenAuth\Assertion; use BjyAuthorize\Service\Authorize; use UnicaenAuth\Service\Traits\UserContextServiceAwareTrait; use Zend\Mvc\Application; use Zend\Mvc\Controller\Plugin\FlashMessenger; use Zend\Mvc\MvcEvent; use Zend\Permissions\Acl\Acl; use Zend\Permissions\Acl\Assertion\AssertionInterface; Loading Loading @@ -33,6 +34,11 @@ abstract class AbstractAssertion implements AssertionInterface, ServiceLocatorAw */ private $role = false; /** * @var FlashMessenger */ private $fm; /** Loading Loading @@ -293,4 +299,17 @@ abstract class AbstractAssertion implements AssertionInterface, ServiceLocatorAw return $serviceAuthorize; } /** * @return FlashMessenger */ protected function flashMessenger() { if (!$this->fm){ $this->fm = $this->getServiceLocator()->get('controllerpluginmanager')->get('flashmessenger'); } return $this->fm; } } No newline at end of file