@@ -333,6 +333,17 @@ static PHP_METHOD(Cursor, isDead)
333
333
RETURN_BOOL (!mongoc_cursor_more (intern -> cursor ));
334
334
} /* }}} */
335
335
336
+ #if PHP_VERSION_ID >= 80000
337
+ static PHP_METHOD (Cursor , getIterator )
338
+ {
339
+ if (zend_parse_parameters_none () == FAILURE ) {
340
+ return ;
341
+ }
342
+
343
+ zend_create_internal_iterator_zval (return_value , getThis ());
344
+ }
345
+ #endif
346
+
336
347
/* {{{ MongoDB\Driver\Cursor function entries */
337
348
ZEND_BEGIN_ARG_INFO_EX (ai_Cursor_setTypeMap , 0 , 0 , 1 )
338
349
ZEND_ARG_ARRAY_INFO (0 , typemap , 0 )
@@ -348,6 +359,9 @@ static zend_function_entry php_phongo_cursor_me[] = {
348
359
PHP_ME (Cursor , getId , ai_Cursor_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
349
360
PHP_ME (Cursor , getServer , ai_Cursor_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
350
361
PHP_ME (Cursor , isDead , ai_Cursor_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
362
+ #if PHP_VERSION_ID >= 80000
363
+ PHP_ME (Cursor , getIterator , ai_Cursor_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
364
+ #endif
351
365
ZEND_NAMED_ME (__construct , PHP_FN (MongoDB_disabled___construct ), ai_Cursor_void , ZEND_ACC_PRIVATE | ZEND_ACC_FINAL )
352
366
ZEND_NAMED_ME (__wakeup , PHP_FN (MongoDB_disabled___wakeup ), ai_Cursor_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
353
367
PHP_FE_END
@@ -502,6 +516,9 @@ void php_phongo_cursor_init_ce(INIT_FUNC_ARGS) /* {{{ */
502
516
PHONGO_CE_DISABLE_SERIALIZATION (php_phongo_cursor_ce );
503
517
php_phongo_cursor_ce -> get_iterator = php_phongo_cursor_get_iterator ;
504
518
519
+ #if PHP_VERSION_ID >= 80000
520
+ zend_class_implements (php_phongo_cursor_ce , 1 , zend_ce_aggregate );
521
+ #endif
505
522
zend_class_implements (php_phongo_cursor_ce , 1 , php_phongo_cursor_interface_ce );
506
523
507
524
memcpy (& php_phongo_handler_cursor , phongo_get_std_object_handlers (), sizeof (zend_object_handlers ));
0 commit comments