From f8242e4e75e77af893caa35e0f73c02f2632ff18 Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Tue, 24 Mar 2009 19:10:43 +0000 Subject: [PATCH] finally, code git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@277707 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongo/mongocode/construct.xml | 105 ++++++++++++++++++++++++ reference/mongo/mongocode/tostring.xml | 77 +++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 reference/mongo/mongocode/construct.xml create mode 100644 reference/mongo/mongocode/tostring.xml diff --git a/reference/mongo/mongocode/construct.xml b/reference/mongo/mongocode/construct.xml new file mode 100644 index 0000000000..89ff994c76 --- /dev/null +++ b/reference/mongo/mongocode/construct.xml @@ -0,0 +1,105 @@ + + + + + + MongoCode::__construct + Creates a new code object + + + + &reftitle.description; + + MongoCode::__construct + stringcode + arrayscopearray() + + + + + &reftitle.parameters; + + + + + code + + + + A string of code. + + + + + + scope + + + + The scope to use for the code. + + + + + + + + + &reftitle.returnvalues; + + Returns a new code object. + + + + + &reftitle.examples; + + <function>MongoCode::__construct</function> example + + 4)); +var_dump($code); + +?> +]]> + + &example.outputs.similar; + + + array(1) { + ["x"]=> + int(4) + } + ["code"]=> + string(80) "function(x) { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } return x-1; }" +} +]]> + + + + + + diff --git a/reference/mongo/mongocode/tostring.xml b/reference/mongo/mongocode/tostring.xml new file mode 100644 index 0000000000..5c22ae86cc --- /dev/null +++ b/reference/mongo/mongocode/tostring.xml @@ -0,0 +1,77 @@ + + + + + + MongoCode::__toString + Returns this code as a string + + + + &reftitle.description; + + public stringMongoCode::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + This code, the scope is not returned. + + + + + &reftitle.examples; + + <function>MongoCode::__toString</function> example + +"hi")); +echo "$code\n"; + +$code = new MongoCode('function() { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } }'); +echo "$code\n"; + +?> +]]> + + &example.outputs.similar; + + + + + + + +