Elastica\Document::__construct PHP Method

__construct() public method

Creates a new document.
public __construct ( integer | string $id = '', array | string $data = [], Type | string $type = '', Index | string $index = '' )
$id integer | string OPTIONAL $id Id is create if empty
$data array | string OPTIONAL Data array
$type Type | string OPTIONAL Type name
$index Index | string OPTIONAL Index name
    public function __construct($id = '', $data = [], $type = '', $index = '')
    {
        $this->setId($id);
        $this->setData($data);
        $this->setType($type);
        $this->setIndex($index);
    }