Advertisement
Guest User

mongodb api spec for zend studio

a guest
Jun 21st, 2011
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 16.84 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Class Mongo
  4.  */
  5. class Mongo {
  6. /**
  7.  * Creates a new database connection object
  8.  * @param string $server
  9.  * @param array $options
  10.  */
  11. public function __construct($server,$options) {}
  12. /**
  13.  * Connects to a database server
  14.  * @return boolean
  15.  */
  16. public function connect() {}
  17. /**
  18.  * Connects to paired database server [deprecated]
  19.  * @return boolean
  20.  */
  21. public function pairConnect() {}
  22. /**
  23.  * Creates a persistent connection with a database server [deprecated]
  24.  * @param string $username
  25.  * @param string $password
  26.  * @return boolean
  27.  */
  28. public function persistConnect($username,$password) {}
  29. /**
  30.  * Creates a persistent connection with paired database servers [deprecated]
  31.  * @param string $username
  32.  * @param string $password
  33.  * @return boolean
  34.  */
  35. public function pairPersistConnect($username,$password) {}
  36. /**
  37.  * Connects with a database server
  38.  * @return boolean
  39.  */
  40. protected function connectUtil() {}
  41. /**
  42.  * String representation of this connection
  43.  * @return string
  44.  */
  45. public function __toString() {}
  46. /**
  47.  * Gets a database
  48.  * @param string $dbname
  49.  * @return MongoDB
  50.  */
  51. public function __get($dbname) {}
  52. /**
  53.  * Gets a database
  54.  * @param string $name
  55.  * @return MongoDB
  56.  */
  57. public function selectDB($name) {}
  58. /**
  59.  * Gets a database collection
  60.  * @param string $db
  61.  * @param string $collection
  62.  * @return MongoCollection
  63.  */
  64. public function selectCollection($db,$collection) {}
  65. /**
  66.  * Drops a database [deprecated]
  67.  * @param mixed $db
  68.  * @return array
  69.  */
  70. public function dropDB($db) {}
  71. /**
  72.  * Check if there was an error on the most recent db operation performed [deprecated]
  73.  * @return array
  74.  */
  75. public function lastError() {}
  76. /**
  77.  * Checks for the last error thrown during a database operation [deprecated]
  78.  * @return array
  79.  */
  80. public function prevError() {}
  81. /**
  82.  * Clears any flagged errors on the connection [deprecated]
  83.  * @return array
  84.  */
  85. public function resetError() {}
  86. /**
  87.  * Creates a database error on the database [deprecated]
  88.  * @return bool
  89.  */
  90. public function forceError() {}
  91. /**
  92.  * Lists all of the databases available.
  93.  * @return array
  94.  */
  95. public function listDBs() {}
  96. /**
  97.  * Closes this database connection
  98.  * @return boolean
  99.  */
  100. public function close() {}
  101. }
  102. /**
  103.  * Class MongoDB
  104.  */
  105. class MongoDB {
  106. /**
  107.  * Creates a new database
  108.  * @param Mongo $conn
  109.  * @param string $name
  110.  */
  111. public function __construct($conn,$name) {}
  112. /**
  113.  * The name of this database
  114.  * @return string
  115.  */
  116. public function __toString() {}
  117. /**
  118.  * Gets a collection
  119.  * @param string $name
  120.  * @return MongoCollection
  121.  */
  122. public function __get($name) {}
  123. /**
  124.  * Fetches toolkit for dealing with files stored in this database
  125.  * @param string $prefix
  126.  * @return MongoGridFS
  127.  */
  128. public function getGridFS($prefix) {}
  129. /**
  130.  * Gets this databases profiling level
  131.  * @return int
  132.  */
  133. public function getProfilingLevel() {}
  134. /**
  135.  * Sets this databases profiling level
  136.  * @param int $level
  137.  * @return int
  138.  */
  139. public function setProfilingLevel($level) {}
  140. /**
  141.  * Drops this database
  142.  * @return array
  143.  */
  144. public function drop() {}
  145. /**
  146.  * Repairs and compacts this database
  147.  * @param bool $preserve_cloned_files
  148.  * @param bool $backup_original_files
  149.  * @return array
  150.  */
  151. public function repair($preserve_cloned_files,$backup_original_files) {}
  152. /**
  153.  * Gets a collection
  154.  * @param string $name
  155.  * @return MongoCollection
  156.  */
  157. public function selectCollection($name) {}
  158. /**
  159.  * Creates a collection
  160.  * @param string $name
  161.  * @param bool $capped
  162.  * @param int $size
  163.  * @param int $max
  164.  * @return MongoCollection
  165.  */
  166. public function createCollection($name,$capped,$size,$max) {}
  167. /**
  168.  * Drops a collection [deprecated]
  169.  * @param mixed $coll
  170.  * @return array
  171.  */
  172. public function dropCollection($coll) {}
  173. /**
  174.  * Get a list of collections in this database
  175.  * @return array
  176.  */
  177. public function listCollections() {}
  178. /**
  179.  * Creates a database reference
  180.  * @param string $collection
  181.  * @param mixed $a
  182.  * @return array
  183.  */
  184. public function createDBRef($collection,$a) {}
  185. /**
  186.  * Fetches the document pointed to by a database reference
  187.  * @param array $ref
  188.  * @return array
  189.  */
  190. public function getDBRef($ref) {}
  191. /**
  192.  * Runs JavaScript code on the database server.
  193.  * @param mixed $code
  194.  * @param array $args
  195.  * @return array
  196.  */
  197. public function execute($code,$args) {}
  198. /**
  199.  * Execute a database command
  200.  * @param array $data
  201.  * @return array
  202.  */
  203. public function command($data) {}
  204. /**
  205.  * Check if there was an error on the most recent db operation performed
  206.  * @return array
  207.  */
  208. public function lastError() {}
  209. /**
  210.  * Checks for the last error thrown during a database operation
  211.  * @return array
  212.  */
  213. public function prevError() {}
  214. /**
  215.  * Clears any flagged errors on the database
  216.  * @return array
  217.  */
  218. public function resetError() {}
  219. /**
  220.  * Creates a database error
  221.  * @return bool
  222.  */
  223. public function forceError() {}
  224. /**
  225.  * Log in to this database
  226.  * @param string $username
  227.  * @param string $password
  228.  * @return array
  229.  */
  230. public function authenticate($username,$password) {}
  231. }
  232. /**
  233.  * Class MongoCollection
  234.  */
  235. class MongoCollection {
  236. /**
  237.  * Creates a new collection
  238.  * @param MongoDB $db
  239.  * @param string $name
  240.  */
  241. public function __construct($db,$name) {}
  242. /**
  243.  * String representation of this collection
  244.  * @return string
  245.  */
  246. public function __toString() {}
  247. /**
  248.  * Gets a collection
  249.  * @param string $name
  250.  * @return MongoCollection
  251.  */
  252. public function __get($name) {}
  253. /**
  254.  * Returns this collections name
  255.  * @return string
  256.  */
  257. public function getName() {}
  258. /**
  259.  * Drops this collection
  260.  * @return array
  261.  */
  262. public function drop() {}
  263. /**
  264.  * Validates this collection
  265.  * @param bool $scan_data
  266.  * @return array
  267.  */
  268. public function validate($scan_data) {}
  269. /**
  270.  * Inserts an array into the collection
  271.  * @param array $a
  272.  * @param array $options
  273.  * @return mixed
  274.  */
  275. public function insert($a,$options) {}
  276. /**
  277.  * Inserts multiple documents into this collection
  278.  * @param array $a
  279.  * @param array $options
  280.  * @return mixed
  281.  */
  282. public function batchInsert($a,$options) {}
  283. /**
  284.  * Update records based on a given criteria
  285.  * @param array $criteria
  286.  * @param array $newobj
  287.  * @param array $options
  288.  * @return boolean
  289.  */
  290. public function update($criteria,$newobj,$options) {}
  291. /**
  292.  * Remove records from this collection
  293.  * @param array $criteria
  294.  * @param array $options
  295.  * @return mixed
  296.  */
  297. public function remove($criteria,$options) {}
  298. /**
  299.  * Querys this collection
  300.  * @param array $query
  301.  * @param array $fields
  302.  * @return MongoCursor
  303.  */
  304. public function find($query,$fields) {}
  305. /**
  306.  * Querys this collection, returning a single element
  307.  * @param array $query
  308.  * @param array $fields
  309.  * @return array
  310.  */
  311. public function findOne($query,$fields) {}
  312. /**
  313.  *
  314.    Creates an index on the given field(s), or does nothing if the index
  315.    already exists
  316.  
  317.  * @param array $keys
  318.  * @param array $options
  319.  * @return boolean
  320.  */
  321. public function ensureIndex($keys,$options) {}
  322. /**
  323.  * Deletes an index from this collection
  324.  * @param string|array $keys
  325.  * @return array
  326.  */
  327. public function deleteIndex($keys) {}
  328. /**
  329.  * Delete all indices for this collection
  330.  * @return array
  331.  */
  332. public function deleteIndexes() {}
  333. /**
  334.  * Returns an array of index names for this collection
  335.  * @return array
  336.  */
  337. public function getIndexInfo() {}
  338. /**
  339.  * Counts the number of documents in this collection
  340.  * @param array $query
  341.  * @param int $limit
  342.  * @param int $skip
  343.  * @return int
  344.  */
  345. public function count($query,$limit,$skip) {}
  346. /**
  347.  * Saves an object to this collection
  348.  * @param array $a
  349.  * @param array $options
  350.  * @return mixed
  351.  */
  352. public function save($a,$options) {}
  353. /**
  354.  * Creates a database reference
  355.  * @param array $a
  356.  * @return array
  357.  */
  358. public function createDBRef($a) {}
  359. /**
  360.  * Fetches the document pointed to by a database reference
  361.  * @param array $ref
  362.  * @return array
  363.  */
  364. public function getDBRef($ref) {}
  365. static protected function toIndexString() {}
  366. /**
  367.  * Performs an operation similar to SQL's GROUP BY command
  368.  * @param mixed $keys
  369.  * @param array $initial
  370.  * @param MongoCode $reduce
  371.  * @param array $options
  372.  * @return array
  373.  */
  374. public function group($keys,$initial,$reduce,$options) {}
  375. }
  376. /**
  377.  * Class MongoCursor
  378.  */
  379. class MongoCursor {
  380. /**
  381.  * Create a new cursor
  382.  * @param resource $connection
  383.  * @param string $ns
  384.  * @param array $query
  385.  * @param array $fields
  386.  */
  387. public function __construct($connection,$ns,$query,$fields) {}
  388. /**
  389.  * Checks if there are any more elements in this cursor
  390.  * @return boolean
  391.  */
  392. public function hasNext() {}
  393. /**
  394.  * Return the next object to which this cursor points, and advance the cursor
  395.  * @return array
  396.  */
  397. public function getNext() {}
  398. /**
  399.  * Limits the number of results returned
  400.  * @param int $num
  401.  * @return MongoCursor
  402.  */
  403. public function limit($num) {}
  404. /**
  405.  * Skips a number of results
  406.  * @param int $num
  407.  * @return MongoCursor
  408.  */
  409. public function skip($num) {}
  410. /**
  411.  * Sets the fields for a query
  412.  * @param array $f
  413.  * @return MongoCursor
  414.  */
  415. public function fields($f) {}
  416. /**
  417.  * Sets whether this query can be done on a slave
  418.  * @param boolean $okay
  419.  * @return MongoCursor
  420.  */
  421. public function slaveOkay($okay) {}
  422. /**
  423.  * Sets whether this cursor will be left open after fetching the last results
  424.  * @param boolean $tail
  425.  * @return MongoCursor
  426.  */
  427. public function tailable($tail) {}
  428. /**
  429.  * Sets whether this cursor will timeout
  430.  * @param boolean $liveForever
  431.  * @return MongoCursor
  432.  */
  433. public function immortal($liveForever) {}
  434. /**
  435.  * Sets a client-side timeout for this query
  436.  * @param int $ms
  437.  * @return MongoCursor
  438.  */
  439. public function timeout($ms) {}
  440. /**
  441.  * Checks if there are documents that have not been sent yet from the database for this cursor
  442.  * @return boolean
  443.  */
  444. public function dead() {}
  445. /**
  446.  * Use snapshot mode for the query
  447.  * @return MongoCursor
  448.  */
  449. public function snapshot() {}
  450. /**
  451.  * Sorts the results by given fields
  452.  * @param array $fields
  453.  * @return MongoCursor
  454.  */
  455. public function sort($fields) {}
  456. /**
  457.  * Gives the database a hint about the query
  458.  * @param array $key_pattern
  459.  * @return MongoCursor
  460.  */
  461. public function hint($key_pattern) {}
  462. /**
  463.  * Adds a top-level key/value pair to a query
  464.  * @param string $key
  465.  * @param mixed $value
  466.  * @return MongoCursor
  467.  */
  468. public function addOption($key,$value) {}
  469. /**
  470.  * Execute the query.
  471.  * @return void
  472.  */
  473. protected function doQuery() {}
  474. /**
  475.  * Returns the current element
  476.  * @return array
  477.  */
  478. public function current() {}
  479. /**
  480.  * Returns the current results _id
  481.  * @return string
  482.  */
  483. public function key() {}
  484. /**
  485.  * Advances the cursor to the next result
  486.  * @return void
  487.  */
  488. public function next() {}
  489. /**
  490.  * Returns the cursor to the beginning of the result set
  491.  * @return void
  492.  */
  493. public function rewind() {}
  494. /**
  495.  * Checks if the cursor is reading a valid result.
  496.  * @return boolean
  497.  */
  498. public function valid() {}
  499. /**
  500.  * Clears the cursor
  501.  * @return void
  502.  */
  503. public function reset() {}
  504. /**
  505.  * Return an explanation of the query, often useful for optimization and debugging
  506.  * @return array
  507.  */
  508. public function explain() {}
  509. /**
  510.  * Counts the number of results for this query
  511.  * @param boolean $foundOnly
  512.  * @return int
  513.  */
  514. public function count($foundOnly) {}
  515. public function info() {}
  516. }
  517. /**
  518.  * Class MongoGridFS
  519.  */
  520. class MongoGridFS extends MongoCollection {
  521. /**
  522.  * Creates new file collections
  523.  * @param MongoDB $db
  524.  * @param string $prefix
  525.  */
  526. public function __construct($db,$prefix) {}
  527. /**
  528.  * Drops the files and chunks collections
  529.  * @return array
  530.  */
  531. public function drop() {}
  532. /**
  533.  * Queries for files
  534.  * @param array $query
  535.  * @param array $fields
  536.  * @return MongoGridFSCursor
  537.  */
  538. public function find($query,$fields) {}
  539. /**
  540.  * Stores a file in the database
  541.  * @param string $filename
  542.  * @param array $extra
  543.  * @param array $options
  544.  * @return mixed
  545.  */
  546. public function storeFile($filename,$extra,$options) {}
  547. /**
  548.  * Chunkifies and stores bytes in the database
  549.  * @param string $bytes
  550.  * @param array $extra
  551.  * @param array $options
  552.  * @return mixed
  553.  */
  554. public function storeBytes($bytes,$extra,$options) {}
  555. /**
  556.  * Returns a single file matching the criteria
  557.  * @param mixed $query
  558.  * @return MongoGridFSFile
  559.  */
  560. public function findOne($query) {}
  561. /**
  562.  * Removes files from the collections
  563.  * @param array $criteria
  564.  * @param array $options
  565.  * @return boolean
  566.  */
  567. public function remove($criteria,$options) {}
  568. /**
  569.  * Saves an uploaded file to the database
  570.  * @param string $name
  571.  * @param string $filename
  572.  * @return mixed
  573.  */
  574. public function storeUpload($name,$filename) {}
  575. }
  576. /**
  577.  * Class MongoGridFSFile
  578.  */
  579. class MongoGridFSFile {
  580. /**
  581.  * Create a new GridFS file
  582.  * @param MongoGridFS $gridfs
  583.  * @param array $file
  584.  */
  585. public function __construct($gridfs,$file) {}
  586. /**
  587.  * Returns this files filename
  588.  * @return string
  589.  */
  590. public function getFilename() {}
  591. /**
  592.  * Returns this files size
  593.  * @return int
  594.  */
  595. public function getSize() {}
  596. /**
  597.  * Writes this file to the filesystem
  598.  * @param string $filename
  599.  * @return int
  600.  */
  601. public function write($filename) {}
  602. /**
  603.  * Returns this files contents as a string of bytes
  604.  * @return string
  605.  */
  606. public function getBytes() {}
  607. }
  608. /**
  609.  * Class MongoGridFSCursor
  610.  */
  611. class MongoGridFSCursor extends MongoCursor {
  612. /**
  613.  * Create a new cursor
  614.  * @param MongoGridFS $gridfs
  615.  * @param resource $connection
  616.  * @param string $ns
  617.  * @param array $query
  618.  * @param array $fields
  619.  */
  620. public function __construct($gridfs,$connection,$ns,$query,$fields) {}
  621. /**
  622.  * Return the next file to which this cursor points, and advance the cursor
  623.  * @return MongoGridFSFile
  624.  */
  625. public function getNext() {}
  626. /**
  627.  * Returns the current file
  628.  * @return MongoGridFSFile
  629.  */
  630. public function current() {}
  631. /**
  632.  * Returns the current results filename
  633.  * @return string
  634.  */
  635. public function key() {}
  636. }
  637. /**
  638.  * Class MongoId
  639.  */
  640. class MongoId {
  641. /**
  642.  * Creates a new id
  643.  * @param string $id
  644.  */
  645. public function __construct($id) {}
  646. /**
  647.  * Returns a hexidecimal representation of this id
  648.  * @return string
  649.  */
  650. public function __toString() {}
  651. /**
  652.  * Gets the number of seconds since the epoch that this id was created
  653.  * @return int
  654.  */
  655. public function getTimestamp() {}
  656. }
  657. /**
  658.  * Class MongoCode
  659.  */
  660. class MongoCode {
  661. /**
  662.  * Creates a new code object
  663.  * @param string $code
  664.  * @param array $scope
  665.  */
  666. public function __construct($code,$scope) {}
  667. /**
  668.  * Returns this code as a string
  669.  * @return string
  670.  */
  671. public function __toString() {}
  672. }
  673. /**
  674.  * Class MongoRegex
  675.  */
  676. class MongoRegex {
  677. /**
  678.  * Creates a new regular expression
  679.  * @param string $regex
  680.  */
  681. public function __construct($regex) {}
  682. /**
  683.  * A string representation of this regular expression
  684.  * @return string
  685.  */
  686. public function __toString() {}
  687. }
  688. /**
  689.  * Class MongoDate
  690.  */
  691. class MongoDate {
  692. /**
  693.  * Creates a new date.
  694.  * @param long $sec
  695.  * @param long $usec
  696.  */
  697. public function __construct($sec,$usec) {}
  698. /**
  699.  * Returns a string representation of this date
  700.  * @return string
  701.  */
  702. public function __toString() {}
  703. }
  704. /**
  705.  * Class MongoBinData
  706.  */
  707. class MongoBinData {
  708. /**
  709.  * Creates a new binary data object.
  710.  * @param string $data
  711.  * @param int $type
  712.  */
  713. public function __construct($data,$type) {}
  714. /**
  715.  * The string representation of this binary data object.
  716.  * @return string
  717.  */
  718. public function __toString() {}
  719. }
  720. /**
  721.  * Class MongoDBRef
  722.  */
  723. class MongoDBRef {
  724. /**
  725.  * Creates a new database reference
  726.  * @param string $collection
  727.  * @param mixed $id
  728.  * @param string $database
  729.  * @return array
  730.  */
  731. static public function create($collection,$id,$database) {}
  732. /**
  733.  * Checks if an array is a database reference
  734.  * @param mixed $ref
  735.  * @return boolean
  736.  */
  737. static public function isRef($ref) {}
  738. /**
  739.  * Fetches the object pointed to by a reference
  740.  * @param MongoDB $db
  741.  * @param array $ref
  742.  * @return array
  743.  */
  744. static public function get($db,$ref) {}
  745. }
  746. /**
  747.  * Class MongoException
  748.  */
  749. class MongoException extends Exception {
  750. }
  751. /**
  752.  * Class MongoCursorException
  753.  */
  754. class MongoCursorException extends MongoException {
  755. }
  756. /**
  757.  * Class MongoCursorTimeoutException
  758.  */
  759. class MongoCursorTimeoutException extends MongoCursorException {
  760. }
  761. /**
  762.  * Class MongoConnectionException
  763.  */
  764. class MongoConnectionException extends MongoException {
  765. }
  766. /**
  767.  * Class MongoGridFSException
  768.  */
  769. class MongoGridFSException extends MongoException {
  770. }
  771. /**
  772.  * Class MongoTimestamp
  773.  */
  774. class MongoTimestamp {
  775. /**
  776.  * Creates a new timestamp.
  777.  * @param long $sec
  778.  * @param long $inc
  779.  */
  780. public function __construct($sec,$inc) {}
  781. /**
  782.  * Returns a string representation of this timestamp
  783.  * @return string
  784.  */
  785. public function __toString() {}
  786. }
  787. /**
  788.  * Class MongoMaxKey
  789.  */
  790. class MongoMaxKey {
  791. }
  792. /**
  793.  * Class MongoMinKey
  794.  */
  795. class MongoMinKey {
  796. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement