Skip to content
Browse files

add AuthorizeAwareInterface and SM initializer to inject the Authoriz…

…e service
  • Loading branch information...
1 parent e750d26 commit b4eb019f3820ff719c33995881aeb4dda74649fe @bjyoungblood committed Sep 19, 2012
Showing with 15 additions and 0 deletions.
  1. +7 −0 Module.php
  2. +8 −0 src/BjyAuthorize/Service/AuthorizeAwareInterface.php
View
7 Module.php
@@ -32,6 +32,13 @@ public function onBootstrap(EventInterface $e)
public function getServiceConfig()
{
return array(
+ 'initializers' => array(
+ function ($instance, $sm) {
+ if ($instance instanceof Service\AuthorizeAwareInterface) {
+ $instance->setAuthorizeService($sm->get('BjyAuthorize\Service\Authorize'));
+ }
+ }
+ ),
'factories' => array(
'BjyAuthorize\Service\Authorize' => 'BjyAuthorize\Service\AuthorizeFactory',
View
8 src/BjyAuthorize/Service/AuthorizeAwareInterface.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace BjyAuthorize\Service;
+
+interface AuthorizeAwareInterface
+{
+ public function setAuthorizeService(Authorize $auth);
+}

0 comments on commit b4eb019

Please sign in to comment.
Something went wrong with that request. Please try again.