BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: C:/usr/local/lib/php/blueshoes-4.2/core/storage/oodb/Bs_OoDbBasics.class.php
BlueShoes Application Framework - storage/oodb @status experimental

Bs_OoDbBasics

Bs_Object
   |
  +-- Bs_OoDbBasics

**********************************************************************

 

public class Bs_OoDbBasics extends Bs_Object

**********************************************************************
Basic function library for Bs_OoDb.class.phpOoDb is the abriviation for "Object Oriented Database"For details on how to use ooDb see Bs_OoDb.class.php (or Bs_OoDbForMySql.class.php)The folling text will discribe details and concepts of the implementation.I decided to explain this class unsing a FAQ list.FAQ:0) INTRO0 a) How are the objetcts stored?0 b) What is a strong and weak reference?0 c) What does soft-Delete mean?1) SCOPE1 a) What is a Scope?1 b) Where is the scope stored?1 c) Scope priority?2) STORAGE TABLE CREATION/MODIFICATION2 a) Are the storage-tables created automaticaly?2 b) What happens if I add new field To the object?3) PERSISTING (STORING)3 a) If the object hasn't changed since the last fetch, does OoDb still write it to the storage?3 b) Are the sub-objects ('has a'-relations) of an object also saved?3 c) Are array of objects also supported?3 d) Are values with NULL supported?3 e) What happens, if objects happen to have the value NULL or are unSet?3 f) What happens if I move a object from one 'Array of Objects' to an other 'Array of Objects'?3 g) How are cyclic referencing objects handled?4) UNPERSISTING (FETCHING)4 b) What happens when I fetch the same object a few times? Do I get a copy?0) INTRO0 a) How are the objects stored?---------------------------------Wrong question for this class, as it should not have any methods to store the data.It only has methods to help the underlying storage. (But we can assume that it's a table based relational Db).See Bs_OoDbForMySql.class.php and/or study the ABSTRACT functions part of Bs_OoDb.class.php0 b) What is a strong and weak reference?---------------------------------------During the work with objects that use other objects in a 'has a'-relation ooDb keeps trackof 'Who's Using Who'. If an object has *no strong references*, ooDb will remove it from thestorage.Well, when is a reverence strong and when weak?By default a reference to an other object is 'strong' unless:a) It's defined in the $_ooDbProperty['reference']='weak'.b) References to other scopes (Db's) are always 'weak'.And what is the use?SAMPLE: (Objects are braced with [])A [Firm] holding a *strong* reference to the 'Array of [Employee]'A [Telephone book] holding an *weak* reference to the 'Array of [Employee]'If the [Firm] fires an [Employee], the [Employee] would never be removed, becauseof the entry in the [Telephone book]. But because this reference is *weak* ooDbwill removed a fired [Employee] anyway.NOTE: Always expect that a *weak* reference may be NULL on unpersist.0 c) What does soft-Delete mean?--------------------------------Read 0 b). Soft delete will remove object data that has *no strong references*, to it.1) SCOPE1 a) What is a scope?---------------------- The scope is the area to store the data. As the underlying storage functionmay use different techniques to store an object it's our believe, that all thesemethods will use a 'scope' to identify the storage area.For a SQL-dbs this would be the <dbName> and for a file-dbs this could be the directory.- It's also used to build target- and source- keys of the object.- It's also used for the $_persistTag of the pObjToPersist.1 b) Where is the scope stored?--------------------------------The scope-information is stored in 2 ways:a) By setting the default scope. That is the scope-info stored in this object (in $pDefaultScope).It is set as a mandatory parameter in persist() / unpersist() / delete()b) By setting the 'strong'-scope of the object. That is a scope attached to the object(in $this->pObjToPersist->_ooDbScope). See function setHardScope().1 c) Scope priority?--------------------1: The 'strong'-scope of the $pObjToPersist is used. (If not empty)2: The default-scope of this object is used. (If not empty)3: If no scope is given, the data will be stored at the 'current' location.That is where the underlying storage handler currently is 'standing'.2) STORAGE TABLE CREATION/MODIFICATION2 a) Are the storage-tables created automatically?-------------------------------------------------By default *NO*. There is a variable $pStorageAutoCreate that may be set to TRUE. The underlyingstorage will the create/modify the tables it needs *BUT* it's a performance killer!Turn it on during develop and the turn it back off. Better to used my tool Bs_OoDbAble.class.php2 b) What happens if I add new field to the object?----------------------------------------------------This depends on the underlying storagehandler. In Bs_OoDbForMySql.class.php will add (but not delete)missing fields if $pStorageAutoCreate==TRUE. It will even try to change the fieldType if it changes.Better to used my tool Bs_OoDbAble.class.php3) PERSISTING (STORING)3 a) If the object hasn't changed since the last fetch, does OoDb still write it to the storage?---------------------------------------------------------------------------------------------NO! To detect if the object has changed I'm using a md5-fingerpring. *BUT* to prepare and calculatethe fingerprint I have to gather the data of the object, sort it, serialize it and finally md5 it.This cost CPU and in some cases where the object is complex I'm not sure if it's worth the effort.If for some reason you wish to force a save for the lonely-data of an object, you may callthe function forceSave(&$object, $force=TRUE). But this shouldn't necessary.3 b) Are the sub-objects ('has a'-relations) of an object also saved?---------------------------------------------------------------------YES, *but* only the objects/object-arrays are saved that are marked as$_ooDbProperty['mode']='object' in the _ooDbProperty variable. The sub-objectmay then have an _ooDbProperty variable too. a.s.o.3 c) Are array of objects also supported?-----------------------------------------YES. If a variable is marked as object (see 3 b). ooDb will detect an array (hash or vector) andassume it's an 'Array of Object'. Or even an 'Array-tree of Objects' (array of array).NOTE: There are some limitation on how deep the tree may be and what happens if the arrayhas cycling references. (See function _flattenObjArray).3 d) Are values with NULL supported?------------------------------------NO! There are a few reasons *not* to support NULL values.1) You don't really need it. It's 99.999% passable to find a substitute for NULL like -1 or -(2^16) or '' or 'NULL' ...2) Can't have index on fields with NULL values.3) Complicated (unperforming) to detect a NULL when unpersisting4) Queries get very complicated.3 e) What happens, if objects happen to have the value NULL or are unSet?-------------------------------------------------------------------------It is ignored during the persist phase.3 f) What happens if I move a object from one 'Array of Objects' to an other 'Array of Objects'?------------------------------------------------------------------------------------------------Quite often you will have a 'main'-object that handles many other objects; shuffling themaround from on 'Array of Objects' to an other 'Array of Objects'.When you persist the 'main'-object now, the references are updated. Any objects that not referencedany more by the 'main'-object are soft-Deleted (See: 0 c) What does soft-Delete mean?).New objects or objects that have changed are stored/updated. (Assuming these objects are markedfor persistence in the _ooDbProperty variable).3 g) How are cyclic referencing objects handled?-------------------------------------------------Cyclic referencing objects (direct or indirect)Sample for direct cycle: An object [A] containing an object [B] and [B] is pointing back to [A]The problem is that this could end in an endless loop. For this reason ooDb keeps track ofwhich objects have been saved, by marking the saved object. The same object is only saved once.4) UNPERSISTING (FETCHING)4 b) What happens when I fetch the same object a few times? Do I get a copy?----------------------------------------------------------------------------During a unpersist *call* all fetched objects are cached. If the *same* object(*same* means: objectName, ID AND scope match) is fetched a second time the objectwill be taken from cash *by reference*. When the call has ended the cache is emptied.It's important to note that a second unpersist *call* would not know aboutthe already fetched objects.So the answer is: A call to unpersist will not create multiple copies of the*same* object. Multiple calls to unpersist will.Most data is hold by pointer, so changes to the data effect immediately *BUT*streamed data is an exception. Streams have to be prepared on every call.That's way caching is default FALSE;Similar effect with the tag info, that depending on the current scope.The ID data must be set to the right tag-info.

Authors
Version4.0.$Revision: 1.1.1.1 $
Copyrightblueshoes.org

 
Direct known subclasses: Bs_OoDb

Methods inherited from Bs_Object

isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean

Public Method Summary

void

Bs_OoDbBasics( $fileName)

Constructor
integer

getID(object [unknown] &$object, [ string $scope ])

Get the objects sorage ID.
void

setID(object [unknown] $ID, string &$object, string $scope)

Set the objects sorage ID.
string

getScope(object [unknown] &$object)

(See header info: Scope)
void

setHardScope(object [unknown] &$object, [ string $scope ])

(See header info: Scope)
void

forceSave(object [unknown] &$object, [ string $force ])

If 'forceSave' is set to TRUE the "md5 autodetect modification" will not be used
void

&getPersistTag(object [unknown] &$object, string $scope)

Status info is set in the $_persistTag -hash. For exsample the ID of the object when it's fetched
void

&flattenObjArray(array &$objTree)

Wrapper for function _flattenObjArray()
void

&_getStreamFields(string $useCach)

I sometimes need all the streamNames from the PersistProperty
void

&getFieldNames([ string $useCach ])

I sometimes need all varNames that will have a filed in the underlying storage

Private Method Summary

void

_setObject(object [unknown] &$pObj, [ string $scope ])

First thing to do for the basic persister function like persist(), unpersist(), delete()
void

&_getOoDbProperty([ string $useCach ])

Collect Info-Routine I
void

_prepareToPersistData([ string $useCach ])

Collect Info-Routine II
void

_reassembleObjectMetaData( &$metaData)

Write the metaData to the current $pObjToPersist.
void

_memorizeObjStored(object [unknown] &$object)

Memorize that the passed object is already stored.
bool

_isObjAlreadyStored(object [unknown] &$object)

Check if current pObjToPersist's as already stored.
void

_unMemorizeObjStored()

Delete the list of all objects, that have already been put into the storage.
void

_memorizeObjFetched(object [unknown] &$object)

Memorize that the passed object is already fetched.
object reference

&_getObjAlreadyFetched(string $className, string $objID, string $scope)

Check if the desired object is already fetched and return a reference to it if so.
void

_unMemorizeObjFetched()

Delete the list of all objects, that have already been fetched.
string

&_calcMd5Fingerprint( &$pMetaData)

Makes the md5 fingerprint calculation.
void

&_flattenObjArray(array &$objTree, object [unknown] &$objList, [ string $hashPrefix, integer $treeDepth ])

We need this function to handle objArray-trees.
void

_setError_Store( $varName, &$error, string $type)

Warning: documentation is missing.
void

&getError_Persist(string $all)

Warning: documentation is missing.
void

_flattenObjArray( &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree)

Warning: documentation is missing.
void

_setError_Fetch( $varName, &$error, string $type)

Warning: documentation is missing.
void

_setError_Delete( $varName, &$error, string $type)

Warning: documentation is missing.
void

&getError_Unpersist(string $all)

Warning: documentation is missing.
void

&getError_Delete(string $all)

Warning: documentation is missing.
void

&errorDump()

Warning: documentation is missing.

Private Field Summary

string

$pMetaData

Cached information from _prepareToPersistData()
string

$pDataHasChanged

Only persist if something has changed.
int

$pObjPutInStorage

A list of all objects, that have already been put into the storage. When persisting, we have
int

$pObjFetchedFromStorage

A list of all objects, that have been already fetched from the storage. When trying to
unknown

$pErrorStore

A vector of the errors that happend during the last persist/unpersist/delete trys.
string

$pObjToPersist

string

$pObjName

string

$pDefaultScope

string

$pStorageAutoCreate

string

$pInfoList

unknown

$pErrorFetch

unknown

$pErrorDelete

Private Constant Summary

BS_OODBBASICS_VERSION >>4.0.$x$<< Warning: documentation is missing.
BS_OODB_STREAM_DEFAULT_NAME >>defaultStream<< Warning: documentation is missing.
BS_OODB_STREAM_PREFIX >>***STREAM***<< Warning: documentation is missing.

Public Method Details

Bs_OoDbBasics

public void Bs_OoDbBasics( $fileName )

  Constructor
During the process of storing '$this' is cloned (copied), reset and reused.Data that has to be kept available is static.Currently the stored/fetched objects are kept in a array and all error duringthe process of store/fetch/delete.

Parameter
$fileName
Warning: documentation is missing.
Returns void


getID

public integer getID( object [unknown] &$object, [ string $scope ] )

  Get the objects sorage ID.
NOTE: Every scope has it's own ID. But it's optional if you use current scope.

Parameter
object [unknown] &$object
The object to get the ID from.
string $scope = >>''<<
(opt, default:''). The scope to use.
Returns integer

. If the object has no ID (in that scope) 0 is returned


setID

public void setID( object [unknown] $ID, string &$object, string $scope )

  Set the objects sorage ID.
NOTE: Every scope has it's own ID. But it's optional if you use current scope.

Parameter
object [unknown] $ID
The object to set the ID to.
string &$object
(opt, default:''). The scope to use.
string $scope
Warning: documentation is missing.
Returns void


getScope

public string getScope( object [unknown] &$object )

  (See header info: Scope)
Get the scope; the area to store the data.NOTE: If the determined scope is the same as the scope currently used by the storage we return ''.A scope with value '' has the meaning to just use the current scope of the storage.

Parameter
object [unknown] &$object
The object to get the scope from.
Returns string

. The scope. If scope is not set OR same as storage scope, return ''.


setHardScope

public void setHardScope( object [unknown] &$object, [ string $scope ] )

  (See header info: Scope)
Set a 'strong'-scope. That is: the passed object will be stored with the given scope.For a SQL-dbs this would mean to *always* store this object in the same DB, usingthe scope as <db_Name>.NOTE: This is the scope with the highest priority.

Parameter
object [unknown] &$object
The object to set.
string $scope = >>''<<
(see above)
Returns void


forceSave

public void forceSave( object [unknown] &$object, [ string $force ] )

  If 'forceSave' is set to TRUE the "md5 autodetect modification" will not be used
and the data will always be stored.

Parameter
object [unknown] &$object
The object to set to force save.
string $force = >>TRUE<<
(default)
Returns void


&getPersistTag

public void &getPersistTag( object [unknown] &$object, string $scope )

  Status info is set in the $_persistTag -hash. For exsample the ID of the object when it's fetched
from the storage. The $_persistTag is dependent on the scope. (See header info: Scope)Thus the ID may differ from one scope to the other.E.g. Imagine this object stored in (or fetched from) db_A.tblFoo and db_B.tblFoo.Quite certin the ID's will differ !!Structure:$_persistTag[$scope] = array('ID' => <ID> // The storage ID'md5' => <md5> // Data fingerprint. Used to autodetect modifications.'forceSave' => [TRUE|FALSE])If no scope is set, a dummy scope 'this' is used.'ID' and 'md5' are set when a object is unpersisted.If 'forceSave' is set to TRUE the "md5 autodetect modification" is ignored.and storage write is forced.NOTE I: The $_persistTag-hash is part of the object we handle. (Not of $this).NOTE II: If no tag is found a default tag will be set.

Parameter
object [unknown] &$object
The object to get the tag from.
string $scope
Warning: documentation is missing.
Returns void


&flattenObjArray

public void &flattenObjArray( array &$objTree )

  Wrapper for function _flattenObjArray()

Parameter
array &$objTree
. Any hash or vector of objects.
Returns void

See Also _flattenObjArray()

&_getStreamFields

public void &_getStreamFields( string $useCach )

  I sometimes need all the streamNames from the PersistProperty

Parameter
string $useCach
Warning: documentation is missing.
Returns void


&getFieldNames

public void &getFieldNames( [ string $useCach ] )

  I sometimes need all varNames that will have a filed in the underlying storage

Parameter
string $useCach = >>TRUE<<
.
Returns void


Private Method Details

_setObject

private void _setObject( object [unknown] &$pObj, [ string $scope ] )

  First thing to do for the basic persister function like persist(), unpersist(), delete()
is to set the object you want to persist/unpersist/delete

Parameter
object [unknown] &$pObj
. The object to handle
string $scope = >>''<<
. The scope to use as *default*. See setScope() and header for details.
Returns void


&_getOoDbProperty

private void &_getOoDbProperty( [ string $useCach ] )

  Collect Info-Routine I
Get and/or autodetect the persist property that tells us *HOW* and *WHAT* to persist.1) Scan the $pObjToPersist for varName's that have to be persisted2) Use the $_ooDbProperty - hash for varName's that have to be persistedReturns a valid varName-hash with the information on how to store the object vars.Caches the data and returns it by reference, so don't fuck with the data.NOTE: The object to persist should have a variable called '$_ooDbProperty', itwill be used to fetch the persist porfile-data. See header info.Structure sample: (For full sturcture info see header)$_ooDbProperty[$varName] = array('mode' => 'lonely','metaType' => [string|blob|<a phpType>],'relation' => ['strong'|'weak'],'index' => [TRUE|FALSE],'readOnly' => [TRUE|FALSE],'ignor' => [TRUE|FALSE]);

Parameter
string $useCach = >>FALSE<<
(default is FALSE).
Returns void


_prepareToPersistData

private void _prepareToPersistData( [ string $useCach ] )

  Collect Info-Routine II
Collects and prepares all data form the $pObjToPersist and puts it ina $pInfoList - hash.a $_pMeataData - hashThis hash includes the data (*wath* to store) and the property info (*how* to store) *plus* it'sit's split in <storeMode>'s.Goals:0) Sort out data with property-attr 'readOnly'==TRUE or 'ignor'==TRUE.1) Skip <varName> that are is *NOT SET* or are *NULL*.NULL is not a supported value to store. Use some other value.2) Serialize data with property-attr 'mode'=='stream' and put it in the pMetaData marked as 'lonely'3) Get object ID (if present) and put it in the pMetaData marked as 'lonely'4) Calculate the md5 fingerprint and determin if data has changed since last fetch.5) Separate the data by <storeMode>'s ['lonely'|'object']. // sam's ooIn this way we can store all data of <storeMode> == 'lonely' into the unterlying storage andcontinue to process the other <storeMode> types.NOTE: <varName> that are *NOT SET* are treated as 'ignor'.Structure:$pInfoList[<storeMode>][<varName>] = array('data' => <Pointer to the data>;'property' => <Pointer to the propertyInfo of varName>); |Where <storeMode> is one of ['lonely'|'object'] // sam's oo$pMetaData[<varName>] = &<varData>

Parameter
string $useCach = >>TRUE<<
default is TRUE.
Returns void


_reassembleObjectMetaData

private void _reassembleObjectMetaData( &$metaData )

  Write the metaData to the current $pObjToPersist.
metaData is expected only to contain 'lonely'- and 'stream'-mode data.This function will unserialize an handle any stream-data found.We expect to find the object-ID in $metaData['ID']. Set ID to 0 if not found.

Parameter
&$metaData
Warning: documentation is missing.
Returns void


_memorizeObjStored

private void _memorizeObjStored( object [unknown] &$object )

  Memorize that the passed object is already stored.
This methode is used to pervent deadlock-loops when objects reference each other.

Parameter
object [unknown] &$object
Returns void


_isObjAlreadyStored

private bool _isObjAlreadyStored( object [unknown] &$object )

  Check if current pObjToPersist's as already stored.

Parameter
object [unknown] &$object
Returns bool

TRUE if already stored, FALSE otherwise


_unMemorizeObjStored

private void _unMemorizeObjStored( )

  Delete the list of all objects, that have already been put into the storage.

Returns void


_memorizeObjFetched

private void _memorizeObjFetched( object [unknown] &$object )

  Memorize that the passed object is already fetched.
This methode is used to pervent deadlock-loops when objects reference each other.

Parameter
object [unknown] &$object
Returns void


&_getObjAlreadyFetched

private object reference &_getObjAlreadyFetched( string $className, string $objID, string $scope )

  Check if the desired object is already fetched and return a reference to it if so.
Otherwise return FALSE.

Parameter
string $className
. The class name.
string $objID
The storage ID.
string $scope
The scope. (See header info)
Returns object reference

if already fetched, FALSE otherwise.


_unMemorizeObjFetched

private void _unMemorizeObjFetched( )

  Delete the list of all objects, that have already been fetched.

Returns void


&_calcMd5Fingerprint

private string &_calcMd5Fingerprint( &$pMetaData )

  Makes the md5 fingerprint calculation.
Just takes a hash, sorts it, serializes it and returns the md5 fingerprint

Parameter
&$pMetaData
Warning: documentation is missing.
Returns string

Of 32 char md5 fingerprint. (See text)


&_flattenObjArray

private void &_flattenObjArray( array &$objTree, object [unknown] &$objList, [ string $hashPrefix, integer $treeDepth ] )

  We need this function to handle objArray-trees.
As input we expect an array-tree (vector or hash) of objects.As output we want a flattend 1-D hash. (See sample below).We do this by makeing a CSV hash-key. On unpersisting we unflattenthe tree in the opposit way.NOTE I: We follow a branch to a maximum depth of 7 to prevent endles looping.NOTE II: Sorry, but I can't handle array-cycles. It's a PHP 4.x problem!E.g. $a=$b=NULL; a$=array('b'=>&$b); b$=array('a'=>&$a);The funtion woun't crash but cycle 7x producing a wrong array.Sample:INPUTroot['root'] = array('a1'=>array('b1'=>$obj, 'b2'=>$obj), 'a2'=>$obj)'root'/ \'a1' 'a2'/ \ |'b1' 'b2' $obj| |$obj $objOUTPUTarray('root;a1;b1'=>$obj, 'root;a1;b2'=>$obj, 'root;a2'=>$obj)

Parameter
array &$objTree
. Any hash or vector of objects.
object [unknown] &$objList
s (used for recursive call)
string $hashPrefix = >>''<<
CSV-hash prefix (used for recursive call)
integer $treeDepth = >>0<<
. See NOTE
Returns void


_setError_Store

private void _setError_Store( $varName, &$error, string $type )

 

Warning: documentation is missing.

Parameter
$varName
Warning: documentation is missing.
&$error
Warning: documentation is missing.
string $type
Warning: documentation is missing.
Returns void


&getError_Persist

private void &getError_Persist( string $all )

 

Warning: documentation is missing.

Parameter
string $all
Warning: documentation is missing.
Returns void


_flattenObjArray

private void _flattenObjArray( &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree, &$objTree )

 

Warning: documentation is missing.

Parameter
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
&$objTree
Warning: documentation is missing.
Returns void


_setError_Fetch

private void _setError_Fetch( $varName, &$error, string $type )

 

Warning: documentation is missing.

Parameter
$varName
Warning: documentation is missing.
&$error
Warning: documentation is missing.
string $type
Warning: documentation is missing.
Returns void


_setError_Delete

private void _setError_Delete( $varName, &$error, string $type )

 

Warning: documentation is missing.

Parameter
$varName
Warning: documentation is missing.
&$error
Warning: documentation is missing.
string $type
Warning: documentation is missing.
Returns void


&getError_Unpersist

private void &getError_Unpersist( string $all )

 

Warning: documentation is missing.

Parameter
string $all
Warning: documentation is missing.
Returns void


&getError_Delete

private void &getError_Delete( string $all )

 

Warning: documentation is missing.

Parameter
string $all
Warning: documentation is missing.
Returns void


&errorDump

private void &errorDump( )

 

Warning: documentation is missing.

Returns void


Private Field Details

$pMetaData

private string $pMetaData

>>NULL<<

Cached information from _prepareToPersistData()
For what we want to do, we need data in different structurs.

See Also _prepareToPersistData()

$pDataHasChanged

private string $pDataHasChanged

>>TRUE<<

Only persist if something has changed.
The auto change detection works with a md5 fingerprint

See Also _prepareToPersistData()

$pObjPutInStorage

private static int $pObjPutInStorage

>><<

A list of all objects, that have already been put into the storage. When persisting, we have
to mark each object with a targetID and when finished we have to remove the marker.That's wy we keep a vector of all objects we marked, thus to unmarke them at the endof persisting. This variable is *static*

See Also _memorizeObjStored()

$pObjFetchedFromStorage

private static int $pObjFetchedFromStorage

>><<

A list of all objects, that have been already fetched from the storage. When trying to
fetching the same object two and more times during a unpersist() -call, the result should be*one* object with the vars pointing to the same object!In this way we also pervent deadlock-loops when objects reference each other. This variable is *static*

See Also _memorizeObjFetched()

$pErrorStore

private static unknown $pErrorStore

>><<

A vector of the errors that happend during the last persist/unpersist/delete trys.
The entries are chronologicaly starting by 0;Structure:pErrorStore[] = array( 'className'=> <class>,'varName' => <varName>,'msg' => <string> or <Exception>NOTE: The errors are stored in 2 paces!a) In the static vars $pErrorStore, -Fetch, -Delete holding *ALL* the errors that occured.b) In the $pObjectToPersist vars $_persistError_Store, -Fetch, -Delete holding only the errorsof that object.


$pObjToPersist

private string $pObjToPersist

>>NULL<<



$pObjName

private string $pObjName

>>''<<



$pDefaultScope

private string $pDefaultScope

>>''<<



$pStorageAutoCreate

private string $pStorageAutoCreate

>>FALSE<<



$pInfoList

private string $pInfoList

>>NULL<<



$pErrorFetch

private unknown $pErrorFetch

>><<



$pErrorDelete

private unknown $pErrorDelete

>><<



Private Constant Details

BS_OODBBASICS_VERSION

define( BS_OODBBASICS_VERSION, >>4.0.$x$<< )
Case: default: case sensitive



BS_OODB_STREAM_DEFAULT_NAME

define( BS_OODB_STREAM_DEFAULT_NAME, >>defaultStream<< )
Case: default: case sensitive



BS_OODB_STREAM_PREFIX

define( BS_OODB_STREAM_PREFIX, >>***STREAM***<< )
Case: default: case sensitive




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta