public function store()
    {
        if ($this->id !== null) {
            $method = 'PUT';
            $path = '/' . $this->id;
        } else {
            $method = 'POST';
            $path = '';
        }
        $response = $this->request($method, $path, [], json_encode($this->data));
        $treatedContent = $response->getTreatedContent();

        $this->id = $treatedContent['_id'];
        $this->version = $treatedContent['_version'];
        $this->dirty = false;
    }
public function store()
    {
        if ($this->id !== null) {
            $method = 'PUT';
            $path = '/' . $this->id;
        } else {
            $method = 'POST';
            $path = '';
        }
        $response = $this->request($method, $path, [], json_encode($this->data));
        $treatedContent = $response->getTreatedContent();

        $this->id = $treatedContent['_id'];
        $this->version = $treatedContent['_version'];
        $this->dirty = false;
    }
public function store ( ) { if ( $ this -> id !== null ) { $ method = 'PUT' ; $ path = '/' . $ this -> id ; } else { $ method = 'POST' ; $ path = '' ; } $ response = $ this -> request ( $ method , $ path , [ ] , json_encode ( $ this -> data ) ) ; $ treatedContent = $ response -> getTreatedContent ( ) ; $ this -> id = $ treatedContent [ '_id' ] ; $ this -> version = $ treatedContent [ '_version' ] ; $ this -> dirty = false ; }
Stores this document. If ID is given, PUT will be used; else POST

@throws ElasticSearchException
@return void
Stores this document . If ID is given PUT will be used ; else POST