| @@ 242-248 (lines=7) @@ | ||
| 239 | $totalQuery['running'] = $running; |
|
| 240 | } |
|
| 241 | ||
| 242 | foreach ($query as $key => $value) { |
|
| 243 | if (!is_string($key)) { |
|
| 244 | throw new \InvalidArgumentException('key in $query was not a string'); |
|
| 245 | } |
|
| 246 | ||
| 247 | $totalQuery["payload.{$key}"] = $value; |
|
| 248 | } |
|
| 249 | ||
| 250 | return $this->collection->count($totalQuery); |
|
| 251 | } |
|
| @@ 165-171 (lines=7) @@ | ||
| 162 | ); |
|
| 163 | ||
| 164 | $completeQuery = ['running' => false]; |
|
| 165 | foreach ($query as $key => $value) { |
|
| 166 | if (!is_string($key)) { |
|
| 167 | throw new \InvalidArgumentException('key in $query was not a string'); |
|
| 168 | } |
|
| 169 | ||
| 170 | $completeQuery["payload.{$key}"] = $value; |
|
| 171 | } |
|
| 172 | ||
| 173 | $completeQuery['earliestGet'] = ['$lte' => new \MongoDB\BSON\UTCDateTime(microtime(true) * 1000)]; |
|
| 174 | ||