public function setUser($uid, array $properties=array(), $eventTime=null)
    {
        $eventTime = $this->getEventTime($eventTime);

        // casting to object so that an empty array would be represented as {}
        if (empty($properties)) {
            $properties = (object)$properties;
        }

        $json = json_encode([
            'event' => '$set',
            'entityType' => 'user',
            'entityId' => $uid,
            'properties' => $properties,
            'eventTime' => $eventTime,
        ]);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }
public function setUser($uid, array $properties=array(), $eventTime=null)
    {
        $eventTime = $this->getEventTime($eventTime);

        // casting to object so that an empty array would be represented as {}
        if (empty($properties)) {
            $properties = (object)$properties;
        }

        $json = json_encode([
            'event' => '$set',
            'entityType' => 'user',
            'entityId' => $uid,
            'properties' => $properties,
            'eventTime' => $eventTime,
        ]);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }
public function setUser ( $ uid , array $ properties = array ( ) , $ eventTime = null ) { $ eventTime = $ this -> getEventTime ( $ eventTime ) ; // casting to object so that an empty array would be represented as {} if ( empty ( $ properties ) ) { $ properties = ( object ) $ properties ; } $ json = json_encode ( [ 'event' => '$set' , 'entityType' => 'user' , 'entityId' => $ uid , 'properties' => $ properties , 'eventTime' => $ eventTime , ] ) ; return $ this -> sendRequest ( 'POST' , $ this -> eventUrl , $ json ) ; }
Set a user entity

@param int|string User Id
@param array Properties of the user entity to set
@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
Set a user entity