Elastica\Bulk::getPath PHP Method

getPath() public method

public getPath ( ) : string
return string
    public function getPath()
    {
        $path = '';
        if ($this->hasIndex()) {
            $path .= $this->getIndex() . '/';
            if ($this->hasType()) {
                $path .= $this->getType() . '/';
            }
        }
        $path .= '_bulk';
        return $path;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @group unit
  */
 public function testGetPath()
 {
     $client = $this->_getClient();
     $bulk = new Bulk($client);
     $this->assertEquals('_bulk', $bulk->getPath());
     $indexName = 'testIndex';
     $bulk->setIndex($indexName);
     $this->assertEquals($indexName . '/_bulk', $bulk->getPath());
     $typeName = 'testType';
     $bulk->setType($typeName);
     $this->assertEquals($indexName . '/' . $typeName . '/_bulk', $bulk->getPath());
 }