/** * creates a JSONPushNotification object from the passed in JSON object * * @param type $vo_json the JSON object * @return JSONPushNotification with the JSON object in it * @author Rob Kurst <*****@*****.**> */ public static function buildFromJSON($vo_json) { // parent::buildFromJSON($vo_json); $o_return = new JSONPushNotification(); $o_return->setJSON($vo_json); return $o_return; }
/** * creates a push notification from the passed in string * * @param type $vs_json the passed in string * @return the push notification * @author Rob Kurst <*****@*****.**> */ public function handlePushNotification($vs_json) { $triple_des = new TripleDESService($this->is_key); $o_json = $triple_des->decrypt($vs_json); $o_json = trim($o_json, ".."); $o_json = json_decode($o_json, TRUE); if (array_key_exists("push_notification_type", $o_json) && $o_json["push_notification_type"] == PushNotification::$XS_PN_TYPE_JSON) { $o_return = JSONPushNotification::buildFromJSON($o_json); } else { $o_return = PushNotification::buildFromJSON($o_json); } return $o_return; }