@@ -492,60 +492,60 @@ bool phongo_split_namespace(char *namespace, char **dbname, char **cname) /* {{{
492492 return true;
493493} /* }}} */
494494
495- mongoc_bulk_operation_t * phongo_writebatch_init (zend_bool ordered ) { /* {{{ */
495+ mongoc_bulk_operation_t * phongo_bulkwrite_init (zend_bool ordered ) { /* {{{ */
496496 return mongoc_bulk_operation_new (ordered );
497497} /* }}} */
498498
499499int phongo_execute_single_insert (mongoc_client_t * client , char * namespace , bson_t * doc , mongoc_write_concern_t * write_concern , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
500500{
501501 bool retval = false;
502- mongoc_bulk_operation_t * batch ;
502+ mongoc_bulk_operation_t * bulk ;
503503
504- batch = phongo_writebatch_init (true);
505- mongoc_bulk_operation_insert (batch , doc );
504+ bulk = phongo_bulkwrite_init (true);
505+ mongoc_bulk_operation_insert (bulk , doc );
506506
507- retval = phongo_execute_write (client , namespace , batch , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
508- mongoc_bulk_operation_destroy (batch );
507+ retval = phongo_execute_write (client , namespace , bulk , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
508+ mongoc_bulk_operation_destroy (bulk );
509509
510510 return retval ;
511511} /* }}} */
512512
513513int phongo_execute_single_update (mongoc_client_t * client , char * namespace , bson_t * query , bson_t * update , mongoc_write_concern_t * write_concern , mongoc_update_flags_t flags , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
514514{
515515 bool retval = false;
516- mongoc_bulk_operation_t * batch ;
516+ mongoc_bulk_operation_t * bulk ;
517517
518- batch = phongo_writebatch_init (true);
518+ bulk = phongo_bulkwrite_init (true);
519519 if (flags & MONGOC_UPDATE_MULTI_UPDATE ) {
520- mongoc_bulk_operation_update_one (batch , query , update , !!(flags & MONGOC_UPDATE_UPSERT ));
520+ mongoc_bulk_operation_update_one (bulk , query , update , !!(flags & MONGOC_UPDATE_UPSERT ));
521521 } else {
522- mongoc_bulk_operation_update (batch , query , update , !!(flags & MONGOC_UPDATE_UPSERT ));
522+ mongoc_bulk_operation_update (bulk , query , update , !!(flags & MONGOC_UPDATE_UPSERT ));
523523 }
524- retval = phongo_execute_write (client , namespace , batch , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
525- mongoc_bulk_operation_destroy (batch );
524+ retval = phongo_execute_write (client , namespace , bulk , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
525+ mongoc_bulk_operation_destroy (bulk );
526526
527527 return retval ;
528528} /* }}} */
529529
530530int phongo_execute_single_delete (mongoc_client_t * client , char * namespace , bson_t * query , mongoc_write_concern_t * write_concern , mongoc_delete_flags_t flags , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
531531{
532532 bool retval = false;
533- mongoc_bulk_operation_t * batch ;
533+ mongoc_bulk_operation_t * bulk ;
534534
535- batch = phongo_writebatch_init (true);
535+ bulk = phongo_bulkwrite_init (true);
536536 if (flags & MONGOC_DELETE_SINGLE_REMOVE ) {
537- mongoc_bulk_operation_remove_one (batch , query );
537+ mongoc_bulk_operation_remove_one (bulk , query );
538538 } else {
539- mongoc_bulk_operation_remove (batch , query );
539+ mongoc_bulk_operation_remove (bulk , query );
540540 }
541541
542- retval = phongo_execute_write (client , namespace , batch , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
543- mongoc_bulk_operation_destroy (batch );
542+ retval = phongo_execute_write (client , namespace , bulk , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
543+ mongoc_bulk_operation_destroy (bulk );
544544
545545 return retval ;
546546} /* }}} */
547547
548- bool phongo_execute_write (mongoc_client_t * client , char * namespace , mongoc_bulk_operation_t * batch , mongoc_write_concern_t * write_concern , int server_hint , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
548+ bool phongo_execute_write (mongoc_client_t * client , char * namespace , mongoc_bulk_operation_t * bulk , mongoc_write_concern_t * write_concern , int server_hint , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
549549{
550550 bson_error_t error ;
551551 bson_t reply ;
@@ -558,18 +558,18 @@ bool phongo_execute_write(mongoc_client_t *client, char *namespace, mongoc_bulk_
558558 return false;
559559 }
560560
561- mongoc_bulk_operation_set_database (batch , dbname );
562- mongoc_bulk_operation_set_collection (batch , collname );
563- mongoc_bulk_operation_set_client (batch , client );
564- mongoc_bulk_operation_set_write_concern (batch , write_concern );
561+ mongoc_bulk_operation_set_database (bulk , dbname );
562+ mongoc_bulk_operation_set_collection (bulk , collname );
563+ mongoc_bulk_operation_set_client (bulk , client );
564+ mongoc_bulk_operation_set_write_concern (bulk , write_concern );
565565 efree (dbname );
566566 efree (collname );
567567
568568 if (server_hint ) {
569- mongoc_bulk_operation_set_hint (batch , server_hint );
569+ mongoc_bulk_operation_set_hint (bulk , server_hint );
570570 }
571571
572- hint = mongoc_bulk_operation_execute (batch , & reply , & error );
572+ hint = mongoc_bulk_operation_execute (bulk , & reply , & error );
573573
574574 /* If there is no error then the command succeeded, but the write not */
575575 if (!hint && (error .code || error .domain )) {
@@ -1608,7 +1608,7 @@ PHP_MINIT_FUNCTION(phongo)
16081608 PHP_MINIT (ReadPreference )(INIT_FUNC_ARGS_PASSTHRU );
16091609 PHP_MINIT (Result )(INIT_FUNC_ARGS_PASSTHRU );
16101610 PHP_MINIT (Server )(INIT_FUNC_ARGS_PASSTHRU );
1611- PHP_MINIT (WriteBatch )(INIT_FUNC_ARGS_PASSTHRU );
1611+ PHP_MINIT (BulkWrite )(INIT_FUNC_ARGS_PASSTHRU );
16121612 PHP_MINIT (WriteConcern )(INIT_FUNC_ARGS_PASSTHRU );
16131613 PHP_MINIT (WriteConcernError )(INIT_FUNC_ARGS_PASSTHRU );
16141614 PHP_MINIT (WriteError )(INIT_FUNC_ARGS_PASSTHRU );
0 commit comments