Example #1
0
 /**
 * Retrieve a service from the manager by name
 *
 * Allows passing an array of options to use when creating the instance.
 * createFromInvokable() will use these and pass them to the instance
 * constructor if not null and a non-empty array.
 *
 * @param string $name
 * @param array  $options
 * @param bool   $usePeeringServiceManagers
 *
 * @return object
 *
 * @throws Exception\ServiceNotFoundException
 * @throws Exception\ServiceNotCreatedException
 * @throws Exception\RuntimeException
 // @codingStandardsIgnoreEnd
 */
 public function get($name, $options = [], $usePeeringServiceManagers = true)
 {
     $handler = parent::get($name, $options, $usePeeringServiceManagers);
     if ($this->disableFaceting) {
         $handler->disableFaceting();
     }
     if ($this->searchTab) {
         $handler->setSearchTab($this->searchTab);
     }
     $handler->setRequest($this->request);
     return $handler;
 }
Example #2
0
 /**
  * Test expected interface.
  *
  * @return void
  *
  * @expectedException        Zend\ServiceManager\Exception\RuntimeException
  * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Autocomplete\AutocompleteInterface
  */
 public function testExpectedInterface()
 {
     $pm = new PluginManager(null);
     $pm->validatePlugin(new \ArrayObject());
 }