コード例 #1
0
ファイル: PluginManagerTest.php プロジェクト: tillk/vufind
 /**
  * Test expected interface.
  *
  * @return void
  *
  * @expectedException        Zend\ServiceManager\Exception\RuntimeException
  * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Search\Base\Params
  */
 public function testExpectedInterface()
 {
     $pm = new PluginManager(null);
     $pm->validatePlugin(new \ArrayObject());
 }
コード例 #2
0
ファイル: RandomRecommend.php プロジェクト: tillk/vufind
 /**
  * Called at the end of the Search Params objects' initFromRequest() method.
  * This method is responsible for setting search parameters needed by the
  * recommendation module and for reading any existing search parameters that may
  * be needed.
  *
  * @param \VuFind\Search\Base\Params $params  Search parameter object
  * @param \Zend\StdLib\Parameters    $request Parameter object representing user
  * request.
  *
  * @return void
  */
 public function init($params, $request)
 {
     if ("retain" !== $this->mode) {
         $randomParams = $this->paramManager->get($params->getSearchClassId());
     } else {
         $randomParams = clone $params;
     }
     foreach ($this->filters as $filter) {
         $randomParams->addFilter($filter);
     }
     $query = $randomParams->getQuery();
     $paramBag = $randomParams->getBackendParameters();
     $this->results = $this->searchService->random($this->backend, $query, $this->limit, $paramBag)->getRecords();
 }
コード例 #3
0
ファイル: SearchParams.php プロジェクト: grharry/vufind
 /**
  * Wrapper to the options plugin manager
  *
  * @param string $type The search type of the object to retrieve
  *
  * @return \VuFind\Search\Base\Options
  */
 public function __invoke($type = 'Solr')
 {
     return $this->manager->get($type);
 }