Skip to content

Commit 12ec810

Browse files
committed
add batch events method
according to the https://docs.prediction.io/datacollection/eventmodel/#3-batch-events-to-the-eventserver code tested, the code works in my 0.9.5 environment
1 parent 040fc48 commit 12ec810

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/predictionio/EventClient.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,20 @@ public function createEvent(array $data) {
249249
return $this->sendRequest('POST', $this->eventUrl, $json);
250250
}
251251

252+
/**
253+
* Create batch events
254+
*
255+
* @param array An array describing the events
256+
*
257+
* @return string JSON response
258+
*
259+
* @throws PredictionIOAPIError Request error
260+
*/
261+
public function createEvents(array $data) {
262+
$json = json_encode($data);
263+
return $this->sendRequest('POST', '/batch' . $this->eventUrl, $json);
264+
}
265+
252266
/**
253267
* Retrieve an event
254268
*

0 commit comments

Comments
 (0)