public function recordUserActionOnItem(
       $event,
       $uid,
       $iid,
       array $properties=array(),
       $eventTime=null
   ) {
        $eventTime = $this->getEventTime($eventTime);
        if (empty($properties)) {
            $properties = (object)$properties;
        }
        $json = json_encode([
            'event' => $event,
            'entityType' => 'user',
            'entityId' => $uid,
            'targetEntityType' => 'item',
            'targetEntityId' => $iid,
            'properties' => $properties,
            'eventTime' => $eventTime,
        ]);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }
public function recordUserActionOnItem(
       $event,
       $uid,
       $iid,
       array $properties=array(),
       $eventTime=null
   ) {
        $eventTime = $this->getEventTime($eventTime);
        if (empty($properties)) {
            $properties = (object)$properties;
        }
        $json = json_encode([
            'event' => $event,
            'entityType' => 'user',
            'entityId' => $uid,
            'targetEntityType' => 'item',
            'targetEntityId' => $iid,
            'properties' => $properties,
            'eventTime' => $eventTime,
        ]);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }
public function recordUserActionOnItem ( $ event , $ uid , $ iid , array $ properties = array ( ) , $ eventTime = null ) { $ eventTime = $ this -> getEventTime ( $ eventTime ) ; if ( empty ( $ properties ) ) { $ properties = ( object ) $ properties ; } $ json = json_encode ( [ 'event' => $ event , 'entityType' => 'user' , 'entityId' => $ uid , 'targetEntityType' => 'item' , 'targetEntityId' => $ iid , 'properties' => $ properties , 'eventTime' => $ eventTime , ] ) ; return $ this -> sendRequest ( 'POST' , $ this -> eventUrl , $ json ) ; }
Record a user action on an item

@param string Event name
@param int|string User Id
@param int|string Item Id
@param array Properties of the event
@param string Time of the event in ISO 8601 format
(e.g. 2014-09-09T16:17:42.937-08:00).
Default is the current time.

@return string JSON response

@throws PredictionIOAPIError Request error
Record a user action on an item