File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,15 +32,22 @@ abstract class AbstractServiceFactory implements FactoryInterface
3232 */
3333 public function getPommOptions (ServiceLocatorInterface $ sl )
3434 {
35+ // Get and check config
3536 $ options = $ sl ->get ('Config ' );
36- $ options = $ options ['pomm ' ];
37-
38- if (null === $ options ) {
39- throw new RuntimeException ('Options could not be found in "pomm". ' );
37+ if (is_null ($ options ) || !array_key_exists ('pomm ' , $ options )) {
38+ throw new \Exception ('Options could not be found in "pomm". ' );
39+ }
40+
41+ // Define default module's values
42+ foreach ($ options ['pomm ' ]['databases ' ] as &$ database ) {
43+ if (!array_key_exists ('class:session_builder ' , $ database )) {
44+ $ database ['class:session_builder ' ] = '\PommProject\ModelManager\SessionBuilder ' ;
45+ }
4046 }
4147
48+ // Set options
49+ $ options = $ options ['pomm ' ];
4250 $ pommOptionsClass = $ this ->getOptionsClass ();
43-
4451 return new $ pommOptionsClass ($ options );
4552 }
4653
You can’t perform that action at this time.
0 commit comments