function process_add(&$response, &$session) { $somappings = new syncml_somappings(); $channel_id = $session->get_channel_id_from_cmd($this->cmdref, $this->msgref); if (!is_null($channel_id)) { switch ($this->data) { case SYNCML_STATUS_OK: // insert a temp mapping so we don't send this item // again if client caches the MAP commands $somappings->insert_mapping($channel_id, NULL, $this->sourceref, 0); } } }
function execute(&$response, &$session) { $somappings = new syncml_somappings(); if ($response->has_global_status_code()) { $response->add_status($this->cmdid, $session->msgid, 'Map', NULL, NULL, $response->get_global_status_code()); return; } $open_channel = $session->get_open_channel($this->source['locuri'], $this->target['locuri']); foreach ($this->mapitem as $item) { $somappings->delete_mapping($open_channel['channel_id'], NULL, $item['target']['locuri'], NULL); $somappings->insert_mapping($open_channel['channel_id'], $item['source']['locuri'], $item['target']['locuri'], 0); } if (isset($this->noresp) && $this->noresp) { return; } $response->add_status($this->cmdid, $session->msgid, 'Map', $this->target['locuri'], $this->source['locuri'], SYNCML_STATUS_OK); }