Private Method Details |
deleteAllObjectRelation |
|
private void deleteAllObjectRelation( $parentClass, $parentID, string $dbName, string $exclueVarNames )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
$parentClass |
|
|
Warning: documentation is missing. |
|
|
|
$parentID |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
|
| string |
$exclueVarNames |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
| Throws |
exception
* |
|
deleteObjectRelation |
|
private void deleteObjectRelation( $parentClass, $parentID, $chieldClass, $chieldID, string $dbName )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
$parentClass |
|
|
Warning: documentation is missing. |
|
|
|
$parentID |
|
|
Warning: documentation is missing. |
|
|
|
$chieldClass |
|
|
Warning: documentation is missing. |
|
|
|
$chieldID |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
| Throws |
exception
* |
|
&deleteObjectData |
|
private void &deleteObjectData( $tblName, $objID, string $dbName )
|
| |
To prevent deadlocks, always start deleting with the main clearInHouse-Table
Delete all entries in the clearInHouse-table and <className>_cih-tables thatpoint to $tblName with ID $objID AND scope=''
|
| Parameter |
|
|
$tblName |
|
|
Warning: documentation is missing. |
|
|
|
$objID |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
| Throws |
exception on fail. |
|
storeObjectData |
|
private integer storeObjectData( &$lonelyList, $tblName, string $dbName )
|
| |
Store the passed $lonelyList-data (=objdect data) in the table.
Special Case when ID>0:We always expect to have an 'ID' in the $lonelyList-dataIf the ID>0 we assume it's an UPDATE (not a INSERT) and we try to UPDATE with the ID as record key*BUT* if for some reason the record isn't present (Because deleted or we are using an other db)MySql will return TRUE, doing nothing! MySql REPLACE would work, but it also would destroy datathat we are not setting. Checking for affectedRows() dosn't solve the problem 100% because whenusing UPDATE, mySQL will not update columns where the new value is the same as the old value.So I had to programm a fallback:if ID>0 try an UPDATE and call affectedRows();if I still get 0 try an INSERT and catch the mySQL error BS_DB_ERROR_ALREADY_EXISTS.
Warning: documentation is missing.
|
| Parameter |
|
|
&$lonelyList |
|
|
Warning: documentation is missing. |
|
|
|
$tblName |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
integer An ID>0 on successfull insert. |
| Throws |
exception on errors |
|
storeClearInHouse |
|
private void storeClearInHouse( &$clearInHouseData, string $dbName )
|
| |
$clearInHouseData[]['parentClass'] = $this->pObjName;
$clearInHouseData[]['parentID'] = $_persistTag['ID'];$clearInHouseData[]['varName'] = $varName;$clearInHouseData[]['scope'] = $persister->getScope();$clearInHouseData[]['chieldClass'] = $persister->pObjName;$clearInHouseData[]['chieldID'] = $chieldObjID;$clearInHouseData[]['hashKey'] = $hashKey;$clearInHouseData[]['weakRef'] = $_ooDbProperty[$varName]['reference'];$clearInHouseData[]['readOnly'] =*
Warning: documentation is missing.
|
| Parameter |
|
|
&$clearInHouseData |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
&fetchCihParents |
|
private array &fetchCihParents( $tblName, $objID, string $reference, string $dbName )
|
| |
NOTE catches exception 'No such table in db' and returns empty array.
|
| Parameter |
|
|
$tblName |
|
|
Warning: documentation is missing. |
|
|
|
$objID |
|
|
Warning: documentation is missing. |
|
|
| string |
$reference |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
array if no data found. |
| Throws |
exception |
|
&fetchCihChildren |
|
private array &fetchCihChildren( $tblName, $objID, string $reference, string $dbName )
|
| |
NOTE catches exception 'No such table in db' and returns empty array.
|
| Parameter |
|
|
$tblName |
|
|
Warning: documentation is missing. |
|
|
|
$objID |
|
|
Warning: documentation is missing. |
|
|
| string |
$reference |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
array if no data found. |
| Throws |
exception |
|
&fetchObjectData |
|
private array &fetchObjectData( $tblName, $sqlSomething, string $dbName )
|
| |
|
| Parameter |
|
|
$tblName |
|
|
Warning: documentation is missing. |
|
|
|
$sqlSomething |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
array with data if OK / NULL if no data or no table found. |
| Throws |
exception |
|
&queryFetch |
|
private void &queryFetch( $completeQuery )
|
| |
Get rec-array of any complete query
|
| Parameter |
|
|
$completeQuery |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
matchDbFields_Versus_OoDbProperty |
|
private void matchDbFields_Versus_OoDbProperty( $dbName, $tblName, &$ooDbProperty )
|
| |
Match the object fields against the table fields of the $tblName in the database.
Return a hash of following format:$dbMatch[<filedName>] = array( 'status' => ['missing'|'mismatch'|'ok'],'metaType' => '','newDbType' => '','currentDbType' => '',)
|
| Parameter |
|
|
$dbName |
|
|
Warning: documentation is missing. |
|
|
|
$tblName |
|
|
Warning: documentation is missing. |
|
|
|
&$ooDbProperty |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
_assembleSqlQueryForClassTbl |
|
private void _assembleSqlQueryForClassTbl( $dbName, $tblName, &$ooDbProperty, string $createAddChange )
|
| |
|
| Parameter |
|
|
$dbName |
|
|
Warning: documentation is missing. |
|
|
|
$tblName |
|
|
Warning: documentation is missing. |
|
|
|
&$ooDbProperty |
|
|
Warning: documentation is missing. |
|
|
| string |
$createAddChange |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
createClassTableFromName |
|
private void createClassTableFromName( string $class, $dbName )
|
| |
If only the className is passed we will try to instanciate the object. If it's not in our
scope -> ExceptionIf you pass a full path <class>.class.php file, we will first try to include the file andthe instanciate the object.
|
| Parameter |
|
| string |
$class |
|
|
. Is either the className or the full path AND file name of a <class>.class.php |
|
|
|
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
&getStorageScope |
|
private void &getStorageScope( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
startTransaction |
|
private void startTransaction( string $transactionId )
|
| |
Optional:
Overload transaction functions if underlying storage provides them.
Warning: documentation is missing.
|
| Parameter |
|
| string |
$transactionId |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
commit |
|
private void commit( string $transactionId )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
| string |
$transactionId |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
rollback |
|
private void rollback( string $transactionId )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
| string |
$transactionId |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
_createClearInHouse |
|
private void _createClearInHouse( $tblName, string $dbName )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
$tblName |
|
|
Warning: documentation is missing. |
|
|
| string |
$dbName |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
_typeTrans |
|
private void _typeTrans( &$dbType, &$metaType )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
&$dbType |
|
|
Warning: documentation is missing. |
|
|
|
&$metaType |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
_dbType2metaType |
|
private void _dbType2metaType( $dbType )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
$dbType |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
_metaType2dbType |
|
private void _metaType2dbType( $metaType )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
$metaType |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|