Basho\Riak\Command\Builder\QueryIndex::build PHP 메소드

build() 공개 메소드

public build ( ) : Basho\Riak\Command\Indexes\Query
리턴 Basho\Riak\Command\Indexes\Query
    public function build()
    {
        $this->validate();
        return new Command\Indexes\Query($this);
    }

Usage Example

예제 #1
0
 /**
  * Test command builder settings for options
  *
  * @dataProvider getLocalNodeConnection
  *
  * @param $riak \Basho\Riak
  */
 public function testOptionSettings($riak)
 {
     // build an object
     $builder = new Command\Builder\QueryIndex($riak);
     $builder->buildBucket('some_bucket', 'some_bucket_type')->withIndexName('foo_int')->withScalarValue(42)->withContinuation('12345')->withReturnTerms(true)->withPaginationSort(true)->withTermFilter('foobar')->withTimeout(43);
     $command = $builder->build();
     $this->assertEquals('12345', $command->getParameter('continuation'));
     $this->assertEquals('true', $command->getParameter('return_terms'));
     $this->assertEquals('true', $command->getParameter('pagination_sort'));
     $this->assertEquals('foobar', $command->getParameter('term_regex'));
     $this->assertEquals(43, $command->getParameter('timeout'));
 }