Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add the jackalope.factory parameter to the DI

  • Loading branch information...
commit a55412758063e42b4872f3863c8ee28043b022f7 1 parent ca8e4a5
Amir Abdou authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 DependencyInjection/DoctrinePHPCRExtension.php
View
12 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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.