GitHub user moeamla opened an issue:

    https://github.com/apache/incubator-predictionio/issues/282

    How can I add items without the entityType value of 'item' in PHP SDK

    Do all items need to have the entityType of 'item'? Lets say I have the 
below entities I want to create:
    
    - location
    - Offer
    - communication 
    - ...etc
    
    Below is the code from the PHP SDK, does it need to be changed to have a 
param as eventType name? or PredictionIO just takes one type of event name?
    
    /**
       * Set an item entity
       *
       * @param int|string Item Id 
       * @param array Properties of the item 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
       */
       public function setItem($iid, array $properties=array(), 
$eventTime=null) {
        $eventTime = $this->getEventTime($eventTime);
        if (empty($properties)) $properties = (object)$properties;
        $json = json_encode([
            'event' => '$set',
            'entityType' => 'item',
            'entityId' => $iid,
            'properties' => $properties,
            'eventTime' => $eventTime,
        ]);
        return $this->sendRequest('POST', $this->eventUrl, $json);
      }

----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to