Example #1
0
 /**
  * @test
  */
 public function canSetAndGet()
 {
     // can set and get a simple value
     $arrayAccessor = new ArrayAccessor();
     $arrayAccessor->set('foo', 'bar');
     $this->assertSame('bar', $arrayAccessor->get('foo'));
     $arrayAccessor->set('one:two:three', 'test');
     $this->assertSame('test', $arrayAccessor->get('one:two:three'));
     $arrayAccessor->set('one:two:three', array('four' => 'test2'));
     $this->assertSame('test2', $arrayAccessor->get('one:two:three:four'));
 }
Example #2
0
 /**
  * This can be used to start a new sub request, e.g. for a faceted search.
  *
  * @param bool $onlyPersistentArguments
  * @return SearchRequest
  */
 public function getCopyForSubRequest($onlyPersistentArguments = true)
 {
     $argumentsArray = $this->argumentsAccessor->getData();
     if ($onlyPersistentArguments) {
         $arguments = new ArrayAccessor();
         foreach ($this->persistentArgumentsPaths as $persistentArgumentPath) {
             if ($this->argumentsAccessor->has($persistentArgumentPath)) {
                 $arguments->set($persistentArgumentPath, $this->argumentsAccessor->get($persistentArgumentPath));
             }
         }
         $argumentsArray = $arguments->getData();
     }
     return new SearchRequest($argumentsArray);
 }
 /**
  * Can be used to overwrite the filterConfiguration.
  *
  * plugin.tx_solr.search.query.filter.
  *
  * @param array $configuration
  */
 public function setSearchQueryFilterConfiguration(array $configuration)
 {
     $this->configurationAccess->set('plugin.tx_solr.search.query.filter.', $configuration);
 }