-
Notifications
You must be signed in to change notification settings - Fork 0
/
PokeMongo.php
225 lines (200 loc) · 4.33 KB
/
PokeMongo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
/**
* Class PokeMongo
*/
class PokeMongo
{
/**
* @var MongoDB
*/
private $mongo;
/**
* PokeMongo constructor.
* @param MongoClient $brock Database connection.
* @param string $misty Database name.
*/
public function __construct(MongoClient $brock, $misty)
{
$this->mongo = new MongoDB($brock, $misty);
}
/**
* @param $teamMystic
* @return MongoCollection
*/
public function iChooseYou($teamMystic)
{
return $this->mongo->selectCollection($teamMystic);
}
/**
* @param $professor
* @param array $oak
* @return array
*/
public function exeggcute($professor, array $oak = [])
{
return $this->mongo->execute($professor, $oak);
}
/**
* @param bool $teamRocket
* @return array
*/
public function catchEmAll($teamRocket = false)
{
return $this->mongo->getCollectionNames($teamRocket);
}
/**
* @param string $pikachu
* @return MongoGridFS
*/
public function getPokeballBelt($pikachu = 'pokeball')
{
return $this->mongo->getGridFS($pikachu);
}
/**
* @param array $options
* @return array
*/
public function pokeRap(array $options = [])
{
return $this->mongo->listCollections($options);
}
/**
* @return array
*/
public function showPokedex()
{
return $this->mongo->getCollectionNames();
}
/**
* @param string $ash
* @param string $ketchum
* @return array
*/
public function raticate($ash, $ketchum)
{
return $this->mongo->authenticate($ash, $ketchum);
}
/**
* @return int
*/
public function getHitPoints()
{
return $this->mongo->getProfilingLevel();
}
/**
* @param int $pikachu
* @return int
*/
public function goToGym($pikachu)
{
return $this->mongo->setProfilingLevel($pikachu);
}
/**
* @return bool
*/
public function beTheVeryBest()
{
return $this->mongo->getSlaveOkay();
}
/**
* @param bool $electrodude
* @return bool
*/
public function thatNoOneEverWas($electrodude)
{
return $this->mongo->setSlaveOkay($electrodude);
}
/**
* @return array
*/
public function transferToProfessor()
{
return $this->mongo->drop();
}
/**
* @param bool $bulbasaur
* @param bool $goldeen
* @return array
*/
public function bringToNurseJoy($bulbasaur = FALSE, $goldeen = FALSE)
{
return $this->mongo->repair($bulbasaur, $goldeen);
}
/**
* @param string $charmander
* @param array $charizard
* @return MongoCollection
*/
public function evolvePokemon($charmander, array $charizard = [])
{
return $this->mongo->createCollection($charmander, $charizard);
}
/**
* @param array $valor
*/
public function registerToPokedex($valor, $instinct)
{
$this->mongo->createDBRef($valor, $instinct);
}
/**
* @param array $jessie
* @param array $james
* @return array
*/
public function useThunderBolt(array $jessie, array $james = [])
{
return $this->mongo->command($jessie, $james);
}
/**
* @return array
*/
public function tenQuestionMarks()
{
return $this->mongo->lastError();
}
/**
* @return array
*/
public function missingNo()
{
return $this->mongo->prevError();
}
/**
* @return array
*/
public function superGlitch()
{
return $this->mongo->resetError();
}
/**
* @return bool
*/
public function zzazzGlitch()
{
return $this->mongo->forceError();
}
/**
* @return array
*/
public function getType()
{
return $this->mongo->getReadPreference();
}
/**
* @param string $gary
* @param array $oak
* @return bool
*/
public function throwPokeball($gary, array $oak)
{
return $this->mongo->setReadPreference($gary, $oak);
}
/**
* @param mixed $nurseJoy
* @param int $officerJenny
*/
public function pickStarter($nurseJoy, $officerJenny)
{
$this->mongo->setWriteConcern($nurseJoy, $officerJenny);
}
}