Files
mongo-php-driver/docs/api/MongoDB/WriteError.php
Jeremy Mikola b1b5568edd PHP-1172: Implement WriteError class
Removed getter for bulk operation corresponding to the index, since that would require reconstructing zvals from the libmongoc structs.
2014-09-24 15:48:32 -04:00

59 lines
976 B
PHP

<?php
namespace MongoDB;
/**
* Value object for a write error (e.g. duplicate key).
*/
final class WriteError
{
/**
* Returns the MongoDB error code
*
* @return integer Server error code
*/
public function getCode()
{
/*** CIMPL ***/
/*
RETURN_LONG(intern->code);
*/
/*** CIMPL ***/
}
/**
* Returns the Batch index where this WriteError occurred in
*
* @return integer Batch index of the error
*/
public function getIndex()
{
/*** CIMPL ***/
/*
RETURN_LONG(intern->index);
*/
/*** CIMPL ***/
}
/**
* Returns the actual error message from the server
*
* @return string Server error message
*/
public function getMessage()
{
/*** CIMPL ***/
/*
RETURN_STRING(intern->message, 1);
*/
/*** CIMPL ***/
}
}
$WriteError["free"] = <<< EOF
if (intern->message) {
efree(intern->message);
}
EOF;