Project

General

Profile

Bug #22643 ยป patch_isOnSymSide.patch

Administrator Admin, 2010-05-13 02:51

View differences:

class.t3lib_loaddbgroup.php 2010-05-13 02:44:13.000000000 +0200
* @return boolean Returns true if looking from the symmetric ("other") side to the relation.
*/
function isOnSymmetricSide($parentUid, $parentConf, $childRec) {
return t3lib_div::testInt($childRec['uid']) && $parentConf['symmetric_field'] && $parentUid == $childRec[$parentConf['symmetric_field']]
$uidOfRelatedRecordInChildRecord = $childRec[$parentConf['symmetric_field']];
if(!intval($uidOfRelatedRecordInChildRecord)) {
$valueParts = t3lib_div::trimExplode('|',$uidOfRelatedRecordInChildRecord);
$itemParts = t3lib_div::revExplode('_', $valueParts[0], 2);
$uidOfRelatedRecordInChildRecord = intval($itemParts[1]);
}
return t3lib_div::testInt($childRec['uid']) && $parentConf['symmetric_field'] && $parentUid == $uidOfRelatedRecordInChildRecord
? true
: false;
}
    (1-1/1)