Elastica\Result::hasFields PHP Method

hasFields() public method

Returns whether result has fields.
public hasFields ( ) : boolean
return boolean
    public function hasFields()
    {
        return $this->hasParam('fields');
    }

Usage Example

Esempio n. 1
0
 /**
  * @group unit
  */
 public function testHasFields()
 {
     $data = array('value set');
     $result = new Result(array());
     $this->assertFalse($result->hasFields());
     $result = new Result(array('_source' => $data));
     $this->assertFalse($result->hasFields());
     $result = new Result(array('fields' => $data));
     $this->assertTrue($result->hasFields());
     $this->assertEquals($data, $result->getFields());
 }