3 |
## $Id$ |
## $Id$ |
4 |
## ------------------------------------------------------------------------------------- |
## ------------------------------------------------------------------------------------- |
5 |
## $Log$ |
## $Log$ |
6 |
|
## Revision 1.7 2003/02/03 03:31:38 jonen |
7 |
|
## - moved '$encoder->toISO()' to 'Remote.php' |
8 |
|
## |
9 |
|
## Revision 1.6 2002/12/22 13:26:20 jonen |
10 |
|
## + added support of tangram independent id (e.g. Data::UUID) toggled by option at conrtuctor |
11 |
|
## |
12 |
## Revision 1.5 2002/12/18 22:36:49 jonen |
## Revision 1.5 2002/12/18 22:36:49 jonen |
13 |
## + added support to get remote objects via backend via 'guid' |
## + added support to get remote objects via backend via 'guid' |
14 |
## + renamed '_loadBackend' to '_loadRemote' |
## + renamed '_loadBackend' to '_loadRemote' |
230 |
// check for guid or oid |
// check for guid or oid |
231 |
if($this->meta[guid]) { |
if($this->meta[guid]) { |
232 |
$args = array( guid => $this->objectId, classname => $this->meta[classname] ); |
$args = array( guid => $this->objectId, classname => $this->meta[classname] ); |
233 |
$result = $this->backend->call('getObjectByGuid', $args ); |
$result = $this->backend->send('getObjectByGuid', $args ); |
234 |
} |
} |
235 |
if($this->meta[oid]) { |
if($this->meta[oid]) { |
236 |
$result = $this->backend->call('getObject', $this->objectId); |
$result = $this->backend->send('getObject', $this->objectId); |
237 |
} |
} |
238 |
|
|
239 |
if ($result) { |
if ($result) { |
240 |
//print "result: " . dumpVar($result) . "<br>"; |
//print "result: " . dumpVar($result) . "<br>"; |
241 |
if (count($result) == 0) { return; } |
if (count($result) == 0) { return; } |
242 |
|
|
|
// ----- move this to _encode some times: $this->_encode() |
|
|
$encoder = new TextEncode($result); |
|
|
$encoder->toISO(); |
|
243 |
if ($_GET[debug]) { |
if ($_GET[debug]) { |
244 |
print dumpVar($result); |
print dumpVar($result); |
245 |
} |
} |
257 |
|
|
258 |
function _saveBackend($result) { |
function _saveBackend($result) { |
259 |
logp(get_class($this) . "->_saveBackend()", LOG_DEBUG); |
logp(get_class($this) . "->_saveBackend()", LOG_DEBUG); |
260 |
$encoder = new TextEncode($result); |
|
261 |
$encoder->toUTF8(); |
//$encoder = new TextEncode($result); |
262 |
$response = $this->backend->send('saveObject', array('oid' => $this->objectId, 'data' => $result) ); |
//$encoder->toUTF8(); |
263 |
|
|
264 |
|
// check for guid or oid |
265 |
|
if($this->meta[guid]) { |
266 |
|
$args = array( 'guid' => $this->objectId, 'classname' => $this->meta[classname], 'data' => $result ); |
267 |
|
$response = $this->backend->send('saveObjectByGuid', $args, array( utf8 => 1) ); |
268 |
|
} |
269 |
|
if($this->meta[oid]) { |
270 |
|
$response = $this->backend->send('saveObject', array('oid' => $this->objectId, 'data' => $result), array( utf8 => 1) ); |
271 |
|
} |
272 |
} |
} |
273 |
|
|
274 |
function _decode() { |
function _decode() { |