Beispiel #1
0
 /**
  * 
  * Get context Element ready to be attached to main Entity Object
  *
  * @param  boolean  $appendattributes lue
  * @return Orion\Context\ContextFactory
  */
 public function getElement($appendattributes = true)
 {
     if ($appendattributes) {
         $this->_contextElement->put("attributes", $this->_attributes);
     }
     return $this->_contextElement->getContext();
 }
Beispiel #2
0
 /**
  * 
  * Returns stdClass to be converted in a json or xml
  * Its build 'contextElements' exactly as archteture used in Json requets
  * 
  * @return stdClass
  */
 public function getRequest()
 {
     $this->commitElement();
     $this->_context->put("entities", $this->_elements);
     $this->_context->put("attributes", $this->_attributes);
     return $this->_context->getContext();
 }
Beispiel #3
0
 /**
  * 
  * Returns stdClass to be converted in a json or xml
  * Its build 'contextElements' exactly as archteture used in Json requets
  * 
  * @return stdClass
  */
 public function getRequest()
 {
     $this->commitElement();
     $this->_context->put("contextElements", $this->_elements);
     $this->_context->put("updateAction", $this->_action);
     return $this->_context->getContext();
 }
Beispiel #4
0
 /**
  * 
  * Build and return restriction context Object
  * @return stdClass
  */
 public function getRequest()
 {
     if (null != $this->_currentscope) {
         $this->commitScope();
     }
     $this->_restriction->put("scopes", $this->_scopes);
     $this->_context->put("restriction", $this->_restriction->getContext());
     return $this->_context->getContext();
 }
Beispiel #5
0
 /**
  * 
  * Returns stdClass to be converted in a json or xml
  * Its build 'contextElements' exactly as archteture used in Json requets
  * 
  * @return stdClass
  */
 public function getRequest($subscriptionId = false)
 {
     $this->commitElement();
     if ($subscriptionId) {
         $this->_context->put("subscriptionId", $subscriptionId);
     }
     $this->_context->put("entities", $this->_elements);
     $this->_context->put("attributes", $this->_attributes);
     $this->_context->put("notifyConditions", $this->_notifyConditions);
     return $this->_context->getContext();
 }
Beispiel #6
0
 /**
  * Unsubscribe Context:
  * @param  string  $subscriptionId 
  * @return string 
  * 
  */
 public function unsubscribeContext($subscriptionId)
 {
     try {
         $url = $this->url . "unsubscribeContext";
         $context = new \Orion\Context\ContextFactory();
         $context->put("subscriptionId", $subscriptionId);
         $reqBody = $context->getContext();
         return $this->restRequest($url, 'POST', $reqBody);
     } catch (Exception $e) {
         var_dump($e);
     }
 }
Beispiel #7
0
 /**
  * 
  * Returns stdClass to be converted in a json or xml
  * Its build 'contextElements' exactly as archteture used in Json requets
  * 
  * @return stdClass
  */
 public function getRequest()
 {
     $this->_context->put("notifyConditions", $this->_notifyConditions);
     return $this->_context->getContext();
 }