diff --git a/module/VuFind/src/VuFind/Search/Base/Options.php b/module/VuFind/src/VuFind/Search/Base/Options.php index 5c501f8ff78717070681c9f516644a82f7af8139..d7e933dd9258c0f918ae2941d2d1904215768d18 100644 --- a/module/VuFind/src/VuFind/Search/Base/Options.php +++ b/module/VuFind/src/VuFind/Search/Base/Options.php @@ -126,6 +126,16 @@ abstract class Options implements ServiceLocatorAwareInterface $this->limitOptions = array($this->defaultLimit); } + /** + * Perform initialization that cannot occur in constructor due to need for + * injected dependencies. + * + * @return void + */ + public function init() + { + } + /** * Get string listing special advanced facet types. * diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index 3d369a8cddd2a669cc500df99155b5314103c984..a3887561c35fb1a1d5272f41108214ce60a6e987 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -86,6 +86,16 @@ class Params implements ServiceLocatorAwareInterface } } + /** + * Perform initialization that cannot occur in constructor due to need for + * injected dependencies. + * + * @return void + */ + public function init() + { + } + /** * Get the search options object. * diff --git a/module/VuFind/src/VuFind/Search/Manager.php b/module/VuFind/src/VuFind/Search/Manager.php index 7fa4554d9bc16c0eec0f0cb60795e5c7650aa3e1..ca4b670bf9e007988c07e5eabd4857b34d6abc33 100644 --- a/module/VuFind/src/VuFind/Search/Manager.php +++ b/module/VuFind/src/VuFind/Search/Manager.php @@ -164,6 +164,7 @@ class Manager implements ServiceLocatorAwareInterface throw new \Exception('Invalid options object.'); } $this->injectDependencies($this->optionsStore[$this->classId]); + $this->optionsStore[$this->classId]->init(); } return $this->optionsStore[$this->classId]; } @@ -184,6 +185,7 @@ class Manager implements ServiceLocatorAwareInterface throw new \Exception('Invalid params object.'); } $this->injectDependencies($params); + $params->init(); return $params; }