@@ -55,10 +55,6 @@ mongoc_bulkwriteopts_t* phongo_bwc_assemble_opts(php_phongo_bulkwritecommand_t*
55
55
mongoc_bulkwriteopts_set_ordered (opts , intern -> ordered );
56
56
mongoc_bulkwriteopts_set_verboseresults (opts , intern -> verbose );
57
57
58
- if (intern -> write_concern ) {
59
- mongoc_bulkwriteopts_set_writeconcern (opts , intern -> write_concern );
60
- }
61
-
62
58
return opts ;
63
59
}
64
60
@@ -131,15 +127,13 @@ static PHP_METHOD(MongoDB_Driver_BulkWriteCommand, __construct)
131
127
Z_PARAM_ARRAY_OR_NULL (zoptions )
132
128
PHONGO_PARSE_PARAMETERS_END ();
133
129
134
- // TODO: Consider removing initialization for zero values
135
- intern -> bw = mongoc_bulkwrite_new ();
136
- intern -> bypass = PHONGO_BULKWRITECOMMAND_BYPASS_UNSET ;
137
- intern -> comment = NULL ;
138
- intern -> let = NULL ;
139
- intern -> num_ops = 0 ;
140
- intern -> ordered = true;
141
- intern -> verbose = false;
142
- intern -> write_concern = NULL ;
130
+ intern -> bw = mongoc_bulkwrite_new ();
131
+ intern -> bypass = PHONGO_BULKWRITECOMMAND_BYPASS_UNSET ;
132
+ intern -> comment = NULL ;
133
+ intern -> let = NULL ;
134
+ intern -> num_ops = 0 ;
135
+ intern -> ordered = true;
136
+ intern -> verbose = false;
143
137
144
138
if (!zoptions ) {
145
139
return ;
@@ -183,17 +177,6 @@ static PHP_METHOD(MongoDB_Driver_BulkWriteCommand, __construct)
183
177
if (php_array_existsc (zoptions , "verboseResults" )) {
184
178
intern -> verbose = php_array_fetchc_bool (zoptions , "verboseResults" );
185
179
}
186
-
187
- if (php_array_existsc (zoptions , "writeConcern" )) {
188
- zval * value = php_array_fetchc_deref (zoptions , "writeConcern" );
189
-
190
- if (Z_TYPE_P (value ) != IS_OBJECT || !instanceof_function (Z_OBJCE_P (value ), php_phongo_writeconcern_ce )) {
191
- phongo_throw_exception (PHONGO_ERROR_INVALID_ARGUMENT , "Expected \"writeConcern\" option to be %s, %s given" , ZSTR_VAL (php_phongo_writeconcern_ce -> name ), zend_zval_type_name (value ));
192
- return ;
193
- }
194
-
195
- intern -> write_concern = mongoc_write_concern_copy (phongo_write_concern_from_zval (value ));
196
- }
197
180
}
198
181
199
182
static PHP_METHOD (MongoDB_Driver_BulkWriteCommand , count )
@@ -763,10 +746,6 @@ static void php_phongo_bulkwritecommand_free_object(zend_object* object)
763
746
if (!Z_ISUNDEF (intern -> session )) {
764
747
zval_ptr_dtor (& intern -> session );
765
748
}
766
-
767
- if (intern -> write_concern ) {
768
- mongoc_write_concern_destroy (intern -> write_concern );
769
- }
770
749
}
771
750
772
751
static zend_object * php_phongo_bulkwritecommand_create_object (zend_class_entry * class_type )
@@ -828,15 +807,6 @@ static HashTable* php_phongo_bulkwritecommand_get_debug_info(zend_object* object
828
807
ADD_ASSOC_NULL_EX (& retval , "session" );
829
808
}
830
809
831
- if (intern -> write_concern ) {
832
- zval write_concern ;
833
-
834
- php_phongo_write_concern_to_zval (& write_concern , intern -> write_concern );
835
- ADD_ASSOC_ZVAL_EX (& retval , "write_concern" , & write_concern );
836
- } else {
837
- ADD_ASSOC_NULL_EX (& retval , "write_concern" );
838
- }
839
-
840
810
done :
841
811
return Z_ARRVAL (retval );
842
812
}
0 commit comments