PHP Classes

File: simpleObjectDB2/example/step4-getObjectInfo.php

Recommend this page to a friend!
  Classes of Ilya Nemihin   simpleObjectDB   simpleObjectDB2/example/step4-getObjectInfo.php   Download  
File: simpleObjectDB2/example/step4-getObjectInfo.php
Role: Example script
Content type: text/plain
Description: step4-getObjectInfo
Class: simpleObjectDB
simple object database
Author: By
Last change:
Date: 21 years ago
Size: 1,137 bytes
 

Contents

Class file image Download
<?php

//---[ simpleObjectDB ]---
// demo-step-4 "getObjectInfo"
//
// get info from added object ('root:person1')
//
//

$include_root = '../include/';
require_once(
$include_root . 'functions/ClassLoader.php' );
load_class( 'PersistenceSystem/PersistenceSystem.php' );

$initParams = array();
$initParams["storageRoot"] = 'root2/';

$oid = 'root:person1';

$persistenceSystem = new PersistenceSystem( $initParams );
$object = $persistenceSystem->getObject( $oid );
if (
$object == '' ){
  print
'object "'. $oid .'"'.' dosnt exists';
  exit;
}

$object_id = $object->getID();
$objects_of_object = $object->getObjects();
$object_oid = $object->getOID();

print
"request for oid: [$oid]\n";
print
"we get object, information:\n";
print
"object's id: [$object_id]\n";
print
"object's oid: [$object_oid]\n";
print
"object contains objects: [". join( ',', $objects_of_object ) ."]\n";

// from object of Person, field 'name', 'age'
print "field 'name': [". $object->getField('name') ."]\n";
print
"field 'IQ': [". $object->getField('IQ') ."]\n";
print
"salary: [". $object->getSalary() ."]\n";


?>