| 3 |
## $Id$ |
## $Id$ |
| 4 |
## ------------------------------------------------------------------------------------- |
## ------------------------------------------------------------------------------------- |
| 5 |
## $Log$ |
## $Log$ |
| 6 |
|
## Revision 1.6 2002/12/22 13:26:20 jonen |
| 7 |
|
## + added support of tangram independent id (e.g. Data::UUID) toggled by option at conrtuctor |
| 8 |
|
## |
| 9 |
## Revision 1.5 2002/12/18 22:36:49 jonen |
## Revision 1.5 2002/12/18 22:36:49 jonen |
| 10 |
## + added support to get remote objects via backend via 'guid' |
## + added support to get remote objects via backend via 'guid' |
| 11 |
## + renamed '_loadBackend' to '_loadRemote' |
## + renamed '_loadBackend' to '_loadRemote' |
| 227 |
// check for guid or oid |
// check for guid or oid |
| 228 |
if($this->meta[guid]) { |
if($this->meta[guid]) { |
| 229 |
$args = array( guid => $this->objectId, classname => $this->meta[classname] ); |
$args = array( guid => $this->objectId, classname => $this->meta[classname] ); |
| 230 |
$result = $this->backend->call('getObjectByGuid', $args ); |
$result = $this->backend->send('getObjectByGuid', $args ); |
| 231 |
} |
} |
| 232 |
if($this->meta[oid]) { |
if($this->meta[oid]) { |
| 233 |
$result = $this->backend->call('getObject', $this->objectId); |
$result = $this->backend->send('getObject', $this->objectId); |
| 234 |
} |
} |
| 235 |
|
|
| 236 |
if ($result) { |
if ($result) { |
| 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() { |