phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT,"Expected \"%s\" option to be string, %s given",zarr_key,zend_zval_type_name(value));
returnfalse;
}
if(Z_STRLEN_P(value)>PHONGO_BSON_MAX_LENGTH){
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT,"Expected \"%s\" option to be <= %"PRId32" bytes, %zu given",opts_key,(int32_t)PHONGO_BSON_MAX_LENGTH,Z_STRLEN_P(value));
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT,"Expected \"hint\" option to be string, array, or object, %s given",zend_get_type_by_const(type));
returnfalse;
}
}
returntrue;
}
/* Initialize the "readConcern" option. Returns true on success; otherwise,
* false is returned and an exception is thrown.
*
* The "readConcern" option should be a MongoDB\Driver\ReadConcern instance,
* which must be converted to a mongoc_read_concern_t. */
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT,"Expected \"readConcern\" option to be %s, %s given",ZSTR_VAL(phongo_readconcern_ce->name),zend_zval_type_name(read_concern));
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT,"Expected \"maxAwaitTimeMS\" option to be >= 0, %"PRId64" given",max_await_time_ms);
returnfalse;
}
if(max_await_time_ms>UINT32_MAX){
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT,"Expected \"maxAwaitTimeMS\" option to be <= %"PRIu32", %"PRId64" given",UINT32_MAX,max_await_time_ms);
phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE,"Expected initialization object to be %s, %s given",ZSTR_VAL(phongo_query_ce->name),zend_zval_type_name(return_value));