@@ -180,107 +180,6 @@ PHP_METHOD(Manager, executeBulkWrite)
180180 phongo_execute_write (intern -> client , namespace , bulk -> bulk , phongo_write_concern_from_zval (zwrite_concern TSRMLS_CC ), -1 , return_value , return_value_used TSRMLS_CC );
181181}
182182/* }}} */
183- /* {{{ proto MongoDB\Driver\WriteResult Manager::executeInsert(string $namespace, array|object $document[, array $insertOptions = array()[, MongoDB\Driver\WriteConcern $writeConcern = null]])
184- Convenience method for single insert operation. */
185- PHP_METHOD (Manager , executeInsert )
186- {
187- php_phongo_manager_t * intern ;
188- char * namespace ;
189- int namespace_len ;
190- zval * document ;
191- zval * insertOptions = NULL ;
192- zval * zwrite_concern = NULL ;
193- bson_t * bson ;
194- (void )return_value_ptr ;
195-
196-
197- intern = (php_phongo_manager_t * )zend_object_store_get_object (getThis () TSRMLS_CC );
198-
199- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "sA|a!O!" , & namespace , & namespace_len , & document , & insertOptions , & zwrite_concern , php_phongo_writeconcern_ce ) == FAILURE ) {
200- return ;
201- }
202-
203-
204- bson = bson_new ();
205- zval_to_bson (document , PHONGO_BSON_ADD_ODS |PHONGO_BSON_ADD_CHILD_ODS , bson , NULL TSRMLS_CC );
206-
207- /* When PHPC-443 is implemented, insertOptions will be parsed for the
208- * bypassDocumentValidation option; however, there's nothing to do now. */
209-
210- phongo_execute_single_insert (intern -> client , namespace , bson , phongo_write_concern_from_zval (zwrite_concern TSRMLS_CC ), -1 , return_value , return_value_used TSRMLS_CC );
211- bson_clear (& bson );
212- }
213- /* }}} */
214- /* {{{ proto MongoDB\Driver\WriteResult Manager::executeUpdate(string $namespace, array|object $zquery, array|object $newObj[, array $updateOptions = array()[, MongoDB\Driver\WriteConcern $writeConcern = null]])
215- Convenience method for single update operation. */
216- PHP_METHOD (Manager , executeUpdate )
217- {
218- php_phongo_manager_t * intern ;
219- char * namespace ;
220- int namespace_len ;
221- zval * zquery ;
222- zval * newObj ;
223- zval * updateOptions = NULL ;
224- zval * zwrite_concern = NULL ;
225- bson_t * query ;
226- bson_t * update ;
227- mongoc_update_flags_t flags = MONGOC_UPDATE_NONE ;
228- (void )return_value_ptr ;
229-
230-
231- intern = (php_phongo_manager_t * )zend_object_store_get_object (getThis () TSRMLS_CC );
232-
233- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "sAA|a!O!" , & namespace , & namespace_len , & zquery , & newObj , & updateOptions , & zwrite_concern , php_phongo_writeconcern_ce ) == FAILURE ) {
234- return ;
235- }
236-
237-
238- query = bson_new ();
239- update = bson_new ();
240- zval_to_bson (zquery , PHONGO_BSON_NONE , query , NULL TSRMLS_CC );
241- zval_to_bson (newObj , PHONGO_BSON_ADD_CHILD_ODS , update , NULL TSRMLS_CC );
242-
243- if (updateOptions ) {
244- flags |= php_array_fetch_bool (updateOptions , "multi" ) ? MONGOC_UPDATE_MULTI_UPDATE : 0 ;
245- flags |= php_array_fetch_bool (updateOptions , "upsert" ) ? MONGOC_UPDATE_UPSERT : 0 ;
246- }
247-
248- phongo_execute_single_update (intern -> client , namespace , query , update , phongo_write_concern_from_zval (zwrite_concern TSRMLS_CC ), -1 , flags , return_value , return_value_used TSRMLS_CC );
249- bson_clear (& query );
250- bson_clear (& update );
251- }
252- /* }}} */
253- /* {{{ proto MongoDB\Driver\WriteResult Manager::executeDelete(string $namespace, array|object $query[, array $deleteOptions = array()[, MongoDB\Driver\WriteConcern $writeConcern = null]])
254- Convenience method for single delete operation. */
255- PHP_METHOD (Manager , executeDelete )
256- {
257- php_phongo_manager_t * intern ;
258- char * namespace ;
259- int namespace_len ;
260- zval * query ;
261- zval * deleteOptions = NULL ;
262- zval * zwrite_concern = NULL ;
263- bson_t * bson ;
264- mongoc_delete_flags_t flags = MONGOC_DELETE_NONE ;
265- (void )return_value_ptr ;
266-
267-
268- intern = (php_phongo_manager_t * )zend_object_store_get_object (getThis () TSRMLS_CC );
269-
270- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "sA|a!O!" , & namespace , & namespace_len , & query , & deleteOptions , & zwrite_concern , php_phongo_writeconcern_ce ) == FAILURE ) {
271- return ;
272- }
273-
274-
275- if (deleteOptions && php_array_fetch_bool (deleteOptions , "limit" )) {
276- flags |= MONGOC_DELETE_SINGLE_REMOVE ;
277- }
278- bson = bson_new ();
279- zval_to_bson (query , PHONGO_BSON_NONE , bson , NULL TSRMLS_CC );
280- phongo_execute_single_delete (intern -> client , namespace , bson , phongo_write_concern_from_zval (zwrite_concern TSRMLS_CC ), -1 , flags , return_value , return_value_used TSRMLS_CC );
281- bson_clear (& bson );
282- }
283- /* }}} */
284183/* {{{ proto MongoDB\Driver\ReadPreference Manager::getReadPreference()
285184 Returns the ReadPreference associated with this Manager */
286185PHP_METHOD (Manager , getReadPreference )
@@ -424,28 +323,6 @@ ZEND_BEGIN_ARG_INFO_EX(ai_Manager_executeBulkWrite, 0, 0, 2)
424323 ZEND_ARG_OBJ_INFO (0 , writeConcern , MongoDB \\Driver \\WriteConcern , 1 )
425324ZEND_END_ARG_INFO ();
426325
427- ZEND_BEGIN_ARG_INFO_EX (ai_Manager_executeInsert , 0 , 0 , 2 )
428- ZEND_ARG_INFO (0 , namespace )
429- ZEND_ARG_INFO (0 , document )
430- ZEND_ARG_ARRAY_INFO (0 , insertOptions , 1 )
431- ZEND_ARG_OBJ_INFO (0 , writeConcern , MongoDB \\Driver \\WriteConcern , 1 )
432- ZEND_END_ARG_INFO ();
433-
434- ZEND_BEGIN_ARG_INFO_EX (ai_Manager_executeUpdate , 0 , 0 , 3 )
435- ZEND_ARG_INFO (0 , namespace )
436- ZEND_ARG_INFO (0 , zquery )
437- ZEND_ARG_INFO (0 , newObj )
438- ZEND_ARG_ARRAY_INFO (0 , updateOptions , 1 )
439- ZEND_ARG_OBJ_INFO (0 , writeConcern , MongoDB \\Driver \\WriteConcern , 1 )
440- ZEND_END_ARG_INFO ();
441-
442- ZEND_BEGIN_ARG_INFO_EX (ai_Manager_executeDelete , 0 , 0 , 2 )
443- ZEND_ARG_INFO (0 , namespace )
444- ZEND_ARG_INFO (0 , query )
445- ZEND_ARG_ARRAY_INFO (0 , deleteOptions , 1 )
446- ZEND_ARG_OBJ_INFO (0 , writeConcern , MongoDB \\Driver \\WriteConcern , 1 )
447- ZEND_END_ARG_INFO ();
448-
449326ZEND_BEGIN_ARG_INFO_EX (ai_Manager_getReadPreference , 0 , 0 , 0 )
450327ZEND_END_ARG_INFO ();
451328
@@ -464,9 +341,6 @@ static zend_function_entry php_phongo_manager_me[] = {
464341 PHP_ME (Manager , executeCommand , ai_Manager_executeCommand , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
465342 PHP_ME (Manager , executeQuery , ai_Manager_executeQuery , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
466343 PHP_ME (Manager , executeBulkWrite , ai_Manager_executeBulkWrite , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
467- PHP_ME (Manager , executeInsert , ai_Manager_executeInsert , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
468- PHP_ME (Manager , executeUpdate , ai_Manager_executeUpdate , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
469- PHP_ME (Manager , executeDelete , ai_Manager_executeDelete , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
470344 PHP_ME (Manager , getReadPreference , ai_Manager_getReadPreference , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
471345 PHP_ME (Manager , getServers , ai_Manager_getServers , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
472346 PHP_ME (Manager , getWriteConcern , ai_Manager_getWriteConcern , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
0 commit comments