Permalink
Browse files

Merge pull request #27 from aabdou/master

Add jackalope.factory to the DI extension
  • Loading branch information...
2 parents ca8e4a5 + a554127 commit 72b15a732230b704717eb457523b3c87ff7028cf @dbu dbu committed Dec 12, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 DependencyInjection/DoctrinePHPCRExtension.php
@@ -150,6 +150,18 @@ private function loadJackalopeSession(array $session, ContainerBuilder $containe
if (isset($session['backend']['expect'])) {
$parameters['jackalope.jackalope.jackrabbit_expect'] = $session['backend']['expect'];
}
+ // Factory
+ if (isset($session['backend']['factory'])) {
+ /**
+ * If it is a class, pass the name as is, else assume it is
+ * a service id and get a reference to it
+ */
+ if (class_exists($session['backend']['factory'])) {
+ $parameters['jackalope.factory'] = $session['backend']['factory'];
+ } else {
+ $parameters['jackalope.factory'] = new Reference($session['backend']['factory']);
+ }
+ }
break;
}

0 comments on commit 72b15a7

Please sign in to comment.