Files
mongo-php-driver/docs/api/MongoDB/WriteConcernError.php
Jeremy Mikola 9e5b4167fe PHP-1171: Move WriteConcernError init function to php_phongo.c
The functions in each class file are not exported (since we don't have headers), and this ultimately needs to be called by the WriteResult initialization function. Therefore, it's best placed in php_phongo.c for now, as we did with WriteError's function.
2014-09-24 15:50:37 -04:00

65 lines
1.1 KiB
PHP

<?php
namespace MongoDB;
/**
* Value object for a write concern error.
*/
final class WriteConcernError
{
/**
* Returns the MongoDB error code
*
* @return integer Server error code
*/
public function getCode()
{
/*** CIMPL ***/
/*
RETURN_LONG(intern->code);
*/
/*** CIMPL ***/
}
/**
* Returns additional metadata for the error
*
* @return array Additional metadata for the error (e.g. {"wtimeout": true})
*/
public function getInfo()
{
/*** CIMPL ***/
/*
if (intern->info && Z_TYPE_P(intern->info) == IS_ARRAY) {
RETURN_ZVAL(intern->info, 1, 0);
}
array_init(return_value);
*/
/*** CIMPL ***/
}
/**
* Returns the actual error message from the server
*
* @return string Server error message
*/
public function getMessage()
{
/*
RETURN_STRING(intern->message, 1);
*/
}
}
$WriteConcernError["free"] = <<< EOF
if (intern->message) {
efree(intern->message);
}
if (intern->info) {
zval_ptr_dtor(&intern->info);
}
EOF;