Overview

Namespaces

  • predictionio

Classes

  • BaseClient
  • EngineClient
  • EventClient
  • FileExporter

Traits

  • Exporter

Exceptions

  • PredictionIOAPIError
  • Overview
  • Namespace
  • Class

Class EventClient

Client for connecting to an Event Server

predictionio\BaseClient
Extended by predictionio\EventClient
Namespace: predictionio
Located at predictionio/EventClient.php
Methods summary
public
# __construct( string $accessKey, string $baseUrl = 'http://localhost:7070', float $timeout = 0, float $connectTimeout = 5 )

Parameters

$accessKey
Key
$baseUrl
URL to the Event Server. Default is localhost:7070.
$timeout

of the request in seconds. Use 0 to wait indefinitely Default is 0.

$connectTimeout

of seconds to wait while trying to connect to a server. Default is 5.

Overrides

predictionio\BaseClient::__construct()
public string
# setUser( integer|string $uid, array $properties = array(), string $eventTime = null )

Set a user entity

Set a user entity

Parameters

$uid
Id
$properties
of the user entity to set
$eventTime

of the event in ISO 8601 format (e.g. 2014-09-09T16:17:42.937-08:00). Default is the current time.

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
public string
# unsetUser( integer|string $uid, array $properties, string $eventTime = null )

Unset a user entity

Unset a user entity

Parameters

$uid
Id
$properties
of the user entity to unset
$eventTime

of the event in ISO 8601 format (e.g. 2014-09-09T16:17:42.937-08:00). Default is the current time.

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
public string
# deleteUser( integer|string $uid, string $eventTime = null )

Delete a user entity

Delete a user entity

Parameters

$uid
Id
$eventTime

of the event in ISO 8601 format (e.g. 2014-09-09T16:17:42.937-08:00). Default is the current time.

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
public string
# setItem( integer|string $iid, array $properties = array(), string $eventTime = null )

Set an item entity

Set an item entity

Parameters

$iid
Id
$properties
of the item entity to set
$eventTime

of the event in ISO 8601 format (e.g. 2014-09-09T16:17:42.937-08:00). Default is the current time.

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
public string
# unsetItem( integer|string $iid, array $properties, string $eventTime = null )

Unset an item entity

Unset an item entity

Parameters

$iid
Id
$properties
of the item entity to unset
$eventTime

of the event in ISO 8601 format (e.g. 2014-09-09T16:17:42.937-08:00). Default is the current time.

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
public string
# deleteItem( integer|string $iid, string $eventTime = null )

Delete an item entity

Delete an item entity

Parameters

$iid
Id
$eventTime

of the event in ISO 8601 format (e.g. 2014-09-09T16:17:42.937-08:00). Default is the current time.

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
public string
# recordUserActionOnItem( string $event, integer|string $uid, integer|string $iid, array $properties = array(), string $eventTime = null )

Record a user action on an item

Record a user action on an item

Parameters

$event
name
$uid
Id
$iid
Id
$properties
of the event
$eventTime

of the event in ISO 8601 format (e.g. 2014-09-09T16:17:42.937-08:00). Default is the current time.

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
public string
# createEvent( array $data )

Create an event

Create an event

Parameters

$data
array describing the event

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
public string
# getEvent( string $eventId )

Retrieve an event

Retrieve an event

Parameters

$eventId
ID

Returns

string
JSON response

Throws

predictionio\PredictionIOAPIError
Request error
Methods inherited from predictionio\BaseClient
getStatus(), sendRequest()
Constants summary
string DATE_TIME_FORMAT
# predictionio\DateTime::ISO8601
Properties inherited from predictionio\BaseClient
$client
PredictionIO API PHP Client API documentation generated by ApiGen