public function delete()
    {
        $this->exitIfModelNotSet();

        $params = [
            'id'    => $this->model->getKey(),
            'type'  => $this->model->getDocumentType(),
            'index' => $this->model->getDocumentIndex(),
        ];

        // check if the document exists before deleting
        if ($this->connection->existsStatement($params)) {
            return $this->connection->deleteStatement($params);
        }

        return true;
    }
public function delete()
    {
        $this->exitIfModelNotSet();

        $params = [
            'id'    => $this->model->getKey(),
            'type'  => $this->model->getDocumentType(),
            'index' => $this->model->getDocumentIndex(),
        ];

        // check if the document exists before deleting
        if ($this->connection->existsStatement($params)) {
            return $this->connection->deleteStatement($params);
        }

        return true;
    }
public function delete ( ) { $ this -> exitIfModelNotSet ( ) ; $ params = [ 'id' => $ this -> model -> getKey ( ) , 'type' => $ this -> model -> getDocumentType ( ) , 'index' => $ this -> model -> getDocumentIndex ( ) , ] ; // check if the document exists before deleting if ( $ this -> connection -> existsStatement ( $ params ) ) { return $ this -> connection -> deleteStatement ( $ params ) ; } return true ; }
Delete a model document.

@return mixed
Delete a model document .