MongoDate::toDateTime

(PECL mongo >= 1.6.0; PHP > 5.3.4) Returns a DateTime object representing this date public DateTime MongoDate::toDateTime ( void ) Returns a DateTime object representation of this date. Returns: This date as a DateTime object. Examples: MongoDate::toDateTime() example This example demonstrates creating a DateTime obje

MongoBinData::__toString

(PECL mongo >= 0.8.1) The string representation of this binary data object. public string MongoBinData::__toString ( void ) Returns: Returns the string "<Mongo Binary Data>". To access the contents of a MongoBinData, use the bin field.

MongoRegex::__construct

(PECL mongo >= 0.8.1) Creates a new regular expression public MongoRegex::__construct ( string $regex ) Creates a new regular expression. Parameters: regex Regular expression string of the form /expr/flags. Returns: Returns a new regular expression. Examples: MongoRegex::__construc

MongoCode::__construct

(PECL mongo >= 0.8.3) Creates a new code object public MongoCode::__construct ( string $code [, array $scope = array() ] ) Parameters: code A string of code. scope The scope to use for the code. Returns: Returns a new code object. Examples: MongoC

MongoDate::__construct

(PECL mongo >= 0.8.1) Creates a new date. public MongoDate::__construct ([ int $sec = time() [, int $usec = 0 ]] ) Creates a new date. If no parameters are given, the current time is used. Parameters: sec Number of seconds since the epoch (i.e. 1 Jan 1970 00:00:00.000 UTC). usec Microseconds. Please be aware though that MongoDB's r

MongoId::__set_state

(PECL mongo >= 1.0.8) Create a dummy MongoId public static MongoId MongoId::__set_state ( array $props ) This function is only used by PHP internally, it shouldn't need to ever be called by the user. It is identical to the function: <?php public static function __set_state($props) {     return new MongoId("000000000000000000000000"); } ?> Parameters: props

MongoCode::__toString

(PECL mongo >= 0.8.3) Returns this code as a string public string MongoCode::__toString ( void ) Returns: This code, the scope is not returned. Examples: MongoCode::__toString() example <?php $code = new MongoCode('return x;', array("x"=>"hi")); echo "$code\n"; $code = new MongoCode('function() { for(i=0;i<10;

MongoId::__toString

(PECL mongo >= 0.8.0) Returns a hexidecimal representation of this id public string MongoId::__toString ( void ) Returns: This id. Examples: MongoId::__toString() example <?php $m = new MongoClient(); $collection = $m->selectDB("foo")->selectCollection("bar"); $collection->insert(array( "x" => "y" )); $c

MongoId::isValid

(PECL mongo >= 1.5.0) Check if a value is a valid ObjectId public static bool MongoId::isValid ( mixed $value ) This method may be used to check a variable before passing it as an argument to MongoId::__construct(). Parameters: value The value to check for validity. Returns: Returns TRUE if value is a MongoId instance or a string consisting of

MongoId::__construct

(PECL mongo >= 0.8.0) Creates a new id public MongoId::__construct ([ string|MongoId $id = NULL ] ) Parameters: id A string (must be 24 hexadecimal characters) or a MongoId instance. Returns: Returns a new id. Changelog: 1.4.0 An exception is thrown when passed invalid string