@@ -83,7 +83,7 @@ PHP_METHOD(WriteResult, getMatchedCount)
83
83
RETURN_LONG (intern -> write_result .nMatched );
84
84
}
85
85
/* }}} */
86
- /* {{{ proto integer WriteResult::getModifiedCount()
86
+ /* {{{ proto integer|null WriteResult::getModifiedCount()
87
87
Returns the number of documents that were actually modified by an update */
88
88
PHP_METHOD (WriteResult , getModifiedCount )
89
89
{
@@ -97,6 +97,9 @@ PHP_METHOD(WriteResult, getModifiedCount)
97
97
return ;
98
98
}
99
99
100
+ if (intern -> write_result .omit_nModified ) {
101
+ RETURN_NULL ();
102
+ }
100
103
101
104
RETURN_LONG (intern -> write_result .nModified );
102
105
}
@@ -433,7 +436,11 @@ HashTable *php_phongo_writeresult_get_debug_info(zval *object, int *is_temp TSRM
433
436
434
437
add_assoc_long_ex (& retval , ZEND_STRS ("nInserted" ), intern -> write_result .nInserted );
435
438
add_assoc_long_ex (& retval , ZEND_STRS ("nMatched" ), intern -> write_result .nMatched );
436
- add_assoc_long_ex (& retval , ZEND_STRS ("nModified" ), intern -> write_result .nModified );
439
+ if (intern -> write_result .omit_nModified ) {
440
+ add_assoc_null_ex (& retval , ZEND_STRS ("nModified" ));
441
+ } else {
442
+ add_assoc_long_ex (& retval , ZEND_STRS ("nModified" ), intern -> write_result .nModified );
443
+ }
437
444
add_assoc_long_ex (& retval , ZEND_STRS ("nRemoved" ), intern -> write_result .nRemoved );
438
445
add_assoc_long_ex (& retval , ZEND_STRS ("nUpserted" ), intern -> write_result .nUpserted );
439
446
0 commit comments