Skip to content

Commit 0c0d334

Browse files
committed
PHPLIB-63: Prototypes for index creation methods
1 parent 786471a commit 0c0d334

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/Collection.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,37 @@ public function __construct(Manager $manager, $ns, WriteConcern $wc = null, Read
6464
list($this->dbname, $this->collname) = explode(".", $ns, 2);
6565
}
6666

67+
/**
68+
* Create a single index in the collection.
69+
*
70+
* @see http://docs.mongodb.org/manual/reference/command/createIndexes/
71+
* @see http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/
72+
* @param array|object $keys
73+
* @param array $options
74+
* @return string The name of the created index
75+
*/
76+
public function createIndex($keys, array $options = array())
77+
{
78+
// TODO
79+
}
80+
81+
/**
82+
* Create multiple indexes in the collection.
83+
*
84+
* TODO: decide if $models should be an array of associative arrays, using
85+
* createIndex()'s parameter names as keys, or tuples, using parameters in
86+
* order (e.g. [keys, options]).
87+
*
88+
* @see http://docs.mongodb.org/manual/reference/command/createIndexes/
89+
* @see http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/
90+
* @param array $models
91+
* @return string[] The names of the created indexes
92+
*/
93+
public function createIndexes(array $models)
94+
{
95+
// TODO
96+
}
97+
6798
/**
6899
* Drop a single index in the collection.
69100
*

0 commit comments

Comments
 (0)