TYPO3
7.6
|
Public Member Functions | |
getWorkspaceId () | |
setWorkspaceId ($workspaceId) | |
isPurged () | |
start ($itemlist, $tablelist, $MMtable= '', $MMuid=0, $currentTable= '', $conf=array()) | |
setFetchAllFields ($allFields) | |
setUpdateReferenceIndex ($updateReferenceIndex) | |
setUseLiveParentIds ($useLiveParentIds) | |
setUseLiveReferenceIds ($useLiveReferenceIds) | |
readList ($itemlist, array $configuration) | |
sortList ($sortby) | |
readMM ($tableName, $uid) | |
writeMM ($MM_tableName, $uid, $prependTableName=false) | |
remapMM ($MM_tableName, $uid, $newUid, $prependTableName=false) | |
readForeignField ($uid, $conf) | |
writeForeignField ($conf, $parentUid, $updateToUid=0, $skipSorting=false) | |
getValueArray ($prependTableName=false) | |
convertPosNeg ($valueArray, $fTable, $nfTable) | |
getFromDB () | |
readyForInterface () | |
countItems ($returnAsArray=true) | |
purgeItemArray ($workspaceId=null) | |
processDeletePlaceholder () | |
Static Public Member Functions | |
static | isOnSymmetricSide ($parentUid, $parentConf, $childRec) |
Public Attributes | |
$registerNonTableValues = false | |
$tableArray = array() | |
$itemArray = array() | |
$nonTableArray = array() | |
$additionalWhere = array() | |
$checkIfDeleted = true | |
$dbPaths = array() | |
$firstTable = '' | |
$secondTable = '' | |
$MM_is_foreign = false | |
$MM_oppositeField = '' | |
$MM_oppositeTable = '' | |
$MM_oppositeFieldConf = '' | |
$MM_isMultiTableRelationship = '' | |
$currentTable | |
$undeleteRecord | |
$MM_match_fields = array() | |
$MM_hasUidField | |
$MM_insert_fields = array() | |
$MM_table_where = '' | |
$results = array() | |
Protected Member Functions | |
purgeItemArrayHandler ($purgeCallback) | |
purgeVersionedIds ($tableName, array $ids) | |
purgeLiveVersionedIds ($tableName, array $ids) | |
purgeDeletePlaceholder ($tableName, array $ids) | |
removeFromItemArray ($tableName, $id) | |
completeOppositeUsageValues ($tableName, array $referenceValues) | |
getLiveDefaultId ($tableName, $id) | |
getDatabaseConnection () | |
Protected Attributes | |
$fetchAllFields = false | |
$MM_oppositeUsage | |
$updateReferenceIndex = true | |
$useLiveParentIds = true | |
$useLiveReferenceIds = true | |
$workspaceId | |
$purged = false | |
Load database groups (relations) Used to process the relations created by the TCA element types "group" and "select" for database records. Manages MM-relations as well.
Definition at line 28 of file RelationHandler.php.
|
protected |
Completes MM values to be written by values from the opposite relation. This method used MM insert field or MM match fields if defined.
string | $tableName | Name of the opposite table |
array | $referenceValues | Values to be written |
Definition at line 1303 of file RelationHandler.php.
References $GLOBALS, and elseif.
Referenced by RelationHandler\writeMM().
convertPosNeg | ( | $valueArray, | |
$fTable, | |||
$nfTable | |||
) |
Converts id numbers from negative to positive.
array | $valueArray | Array of [table]_[id] pairs. |
string | $fTable | Foreign table (the one used for positive numbers) |
string | $nfTable | Negative foreign table |
Definition at line 981 of file RelationHandler.php.
References MathUtility\canBeInterpretedAsInteger(), and GeneralUtility\logDeprecatedFunction().
countItems | ( | $returnAsArray = true | ) |
Counts the items in $this->itemArray and puts this value in an array by default.
bool | $returnAsArray | Whether to put the count value in an array |
Definition at line 1073 of file RelationHandler.php.
|
protected |
Definition at line 1365 of file RelationHandler.php.
References $GLOBALS.
Referenced by RelationHandler\purgeDeletePlaceholder(), RelationHandler\purgeLiveVersionedIds(), and RelationHandler\purgeVersionedIds().
getFromDB | ( | ) |
Reads all records from internal tableArray into the internal ->results array where keys are table names and for each table, records are stored with uids as their keys. If $this->fetchAllFields is false you can save a little memory since only uid,pid and a few other fields are selected.
Definition at line 1008 of file RelationHandler.php.
References $GLOBALS, and RelationHandler\$results.
|
protected |
Gets the record uid of the live default record. If already pointing to the live record, the submitted record uid is returned.
string | $tableName | |
int | $id |
Definition at line 1332 of file RelationHandler.php.
References BackendUtility\getLiveVersionIdOfRecord().
Referenced by RelationHandler\readForeignField(), RelationHandler\readList(), and RelationHandler\writeForeignField().
getValueArray | ( | $prependTableName = false | ) |
After initialization you can extract an array of the elements from the object. Use this function for that.
bool | $prependTableName | If set, then table names will ALWAYS be prepended (unless its a _NO_TABLE value) |
Definition at line 954 of file RelationHandler.php.
getWorkspaceId | ( | ) |
Gets the current workspace id.
Definition at line 221 of file RelationHandler.php.
References $GLOBALS, and RelationHandler\$workspaceId.
Referenced by RelationHandler\processDeletePlaceholder(), RelationHandler\purgeDeletePlaceholder(), RelationHandler\purgeItemArray(), and RelationHandler\readForeignField().
|
static |
Checks, if we're looking from the "other" side, the symmetric side, to a symmetric relation.
string | $parentUid | The uid of the parent record |
array | $parentConf | The TCA configuration of the parent field embedding the child records |
array | $childRec | The record row of the child record |
Definition at line 1288 of file RelationHandler.php.
References MathUtility\canBeInterpretedAsInteger().
isPurged | ( | ) |
Whether item array has been purged in this instance.
Definition at line 244 of file RelationHandler.php.
References RelationHandler\$purged.
processDeletePlaceholder | ( | ) |
Removes items having a delete placeholder from $this->itemArray
Definition at line 1135 of file RelationHandler.php.
References RelationHandler\getWorkspaceId(), and RelationHandler\purgeItemArrayHandler().
|
protected |
Purges ids that have a delete placeholder
string | $tableName | |
array | $ids |
Definition at line 1245 of file RelationHandler.php.
References Enumeration\cast(), VersionState\DELETE_PLACEHOLDER, RelationHandler\getDatabaseConnection(), and RelationHandler\getWorkspaceId().
purgeItemArray | ( | $workspaceId = null | ) |
NULL | int | $workspaceId |
Definition at line 1109 of file RelationHandler.php.
References RelationHandler\$workspaceId, RelationHandler\getWorkspaceId(), and RelationHandler\purgeItemArrayHandler().
Referenced by RelationHandler\start().
|
protected |
Handles a purge callback on $this->itemArray
callable | $purgeCallback |
Definition at line 1150 of file RelationHandler.php.
References BackendUtility\isTableWorkspaceEnabled(), and RelationHandler\removeFromItemArray().
Referenced by RelationHandler\processDeletePlaceholder(), and RelationHandler\purgeItemArray().
|
protected |
Purges ids that are live but have an accordant version.
string | $tableName | |
array | $ids |
Definition at line 1212 of file RelationHandler.php.
References RelationHandler\getDatabaseConnection().
|
protected |
Purges ids that are versioned.
string | $tableName | |
array | $ids |
Definition at line 1180 of file RelationHandler.php.
References RelationHandler\getDatabaseConnection().
readForeignField | ( | $uid, | |
$conf | |||
) |
Reads items from a foreign_table, that has a foreign_field (uid of the parent record) and stores the parts in the internal array itemArray and tableArray.
int | $uid | The uid of the parent record (this value is also on the foreign_table in the foreign_field) |
array | $conf | TCA configuration for current field |
Definition at line 756 of file RelationHandler.php.
References $GLOBALS, RelationHandler\$undeleteRecord, BackendUtility\deleteClause(), elseif, RelationHandler\getLiveDefaultId(), RelationHandler\getWorkspaceId(), and BackendUtility\isTableWorkspaceEnabled().
Referenced by RelationHandler\start().
readList | ( | $itemlist, | |
array | $configuration | ||
) |
Explodes the item list and stores the parts in the internal arrays itemArray and tableArray from MM records.
string | $itemlist | Item list |
array | $configuration | Parent field configuration |
Definition at line 388 of file RelationHandler.php.
References RelationHandler\$firstTable, $GLOBALS, MathUtility\canBeInterpretedAsInteger(), RelationHandler\getLiveDefaultId(), BackendUtility\isTableWorkspaceEnabled(), and GeneralUtility\trimExplode().
Referenced by RelationHandler\start().
readMM | ( | $tableName, | |
$uid | |||
) |
Reads the record tablename/id into the internal arrays itemArray and tableArray from MM records. You can call this function after start if you supply no list to start()
string | $tableName | MM Tablename |
int | $uid | Local UID |
Definition at line 500 of file RelationHandler.php.
References RelationHandler\$additionalWhere, RelationHandler\$firstTable, $GLOBALS, RelationHandler\$MM_oppositeTable, and elseif.
Referenced by RelationHandler\start().
readyForInterface | ( | ) |
Prepare items from itemArray to be transferred to the TCEforms interface (as a comma list)
Definition at line 1048 of file RelationHandler.php.
References $GLOBALS, GeneralUtility\fixed_lgd_cs(), and BackendUtility\getRecordTitle().
remapMM | ( | $MM_tableName, | |
$uid, | |||
$newUid, | |||
$prependTableName = false |
|||
) |
Remaps MM table elements from one local uid to another Does NOT update the reference index for you, must be called subsequently to do that!
string | $MM_tableName | MM table name |
int | $uid | Local, current UID |
int | $newUid | Local, new UID |
bool | $prependTableName | If set, then table names will always be written. |
Definition at line 716 of file RelationHandler.php.
References RelationHandler\$additionalWhere, $GLOBALS, and RelationHandler\$MM_isMultiTableRelationship.
|
protected |
Definition at line 1269 of file RelationHandler.php.
Referenced by RelationHandler\purgeItemArrayHandler().
setFetchAllFields | ( | $allFields | ) |
Sets $fetchAllFields
bool | $allFields | enables fetching of all fields in getFromDB() |
Definition at line 349 of file RelationHandler.php.
setUpdateReferenceIndex | ( | $updateReferenceIndex | ) |
Sets whether the reference index shall be updated.
bool | $updateReferenceIndex | Whether the reference index shall be updated |
Definition at line 360 of file RelationHandler.php.
References RelationHandler\$updateReferenceIndex.
setUseLiveParentIds | ( | $useLiveParentIds | ) |
bool | $useLiveParentIds |
Definition at line 368 of file RelationHandler.php.
References RelationHandler\$useLiveParentIds.
setUseLiveReferenceIds | ( | $useLiveReferenceIds | ) |
bool | $useLiveReferenceIds |
Definition at line 376 of file RelationHandler.php.
References RelationHandler\$useLiveReferenceIds.
setWorkspaceId | ( | $workspaceId | ) |
Sets the current workspace id.
int | $workspaceId |
Definition at line 234 of file RelationHandler.php.
References RelationHandler\$workspaceId.
sortList | ( | $sortby | ) |
Does a sorting on $this->itemArray depending on a default sortby field. This is only used for automatic sorting of comma separated lists. This function is only relevant for data that is stored in comma separated lists!
string | $sortby | The default_sortby field/command (e.g. 'price DESC') |
Definition at line 465 of file RelationHandler.php.
References $GLOBALS, and elseif.
Referenced by RelationHandler\start().
start | ( | $itemlist, | |
$tablelist, | |||
$MMtable = '' , |
|||
$MMuid = 0 , |
|||
$currentTable = '' , |
|||
$conf = array() |
|||
) |
Initialization of the class.
string | $itemlist | List of group/select items |
string | $tablelist | Comma list of tables, first table takes priority if no table is set for an entry in the list. |
string | $MMtable | Name of a MM table. |
int | $MMuid | Local UID for MM lookup |
string | $currentTable | Current table name |
array | $conf | TCA configuration for current field |
Definition at line 260 of file RelationHandler.php.
References RelationHandler\$currentTable, $GLOBALS, RelationHandler\$MM_match_fields, RelationHandler\$MM_oppositeField, RelationHandler\$MM_oppositeTable, elseif, RelationHandler\purgeItemArray(), RelationHandler\readForeignField(), RelationHandler\readList(), RelationHandler\readMM(), RelationHandler\sortList(), and GeneralUtility\trimExplode().
writeForeignField | ( | $conf, | |
$parentUid, | |||
$updateToUid = 0 , |
|||
$skipSorting = false |
|||
) |
Write the sorting values to a foreign_table, that has a foreign_field (uid of the parent record)
array | $conf | TCA configuration for current field |
int | $parentUid | The uid of the parent record |
int | $updateToUid | If this is larger than zero it will be used as foreign UID instead of the given $parentUid (on Copy) |
bool | $skipSorting | Do not update the sorting columns, this could happen for imported values |
Definition at line 842 of file RelationHandler.php.
References RelationHandler\$currentTable, $GLOBALS, MathUtility\canBeInterpretedAsInteger(), Enumeration\cast(), elseif, RelationHandler\getLiveDefaultId(), BackendUtility\getRecord(), BackendUtility\isTableWorkspaceEnabled(), and VersionState\NEW_PLACEHOLDER_VERSION.
writeMM | ( | $MM_tableName, | |
$uid, | |||
$prependTableName = false |
|||
) |
Writes the internal itemArray to MM table:
string | $MM_tableName | MM table name |
int | $uid | Local UID |
bool | $prependTableName | If set, then table names will always be written. |
Definition at line 563 of file RelationHandler.php.
References RelationHandler\$additionalWhere, RelationHandler\$currentTable, $GLOBALS, RelationHandler\$MM_insert_fields, and RelationHandler\completeOppositeUsageValues().
$additionalWhere = array() |
Definition at line 69 of file RelationHandler.php.
Referenced by RelationHandler\readMM(), RelationHandler\remapMM(), and RelationHandler\writeMM().
$checkIfDeleted = true |
Definition at line 76 of file RelationHandler.php.
$currentTable |
Definition at line 138 of file RelationHandler.php.
Referenced by RelationHandler\start(), RelationHandler\writeForeignField(), and RelationHandler\writeMM().
$dbPaths = array() |
Definition at line 81 of file RelationHandler.php.
|
protected |
Definition at line 35 of file RelationHandler.php.
$firstTable = '' |
Definition at line 88 of file RelationHandler.php.
Referenced by RelationHandler\readList(), and RelationHandler\readMM().
$itemArray = array() |
Definition at line 57 of file RelationHandler.php.
$MM_hasUidField |
Definition at line 161 of file RelationHandler.php.
$MM_insert_fields = array() |
Definition at line 168 of file RelationHandler.php.
Referenced by RelationHandler\writeMM().
$MM_is_foreign = false |
Definition at line 103 of file RelationHandler.php.
$MM_isMultiTableRelationship = '' |
Definition at line 131 of file RelationHandler.php.
Referenced by RelationHandler\remapMM().
$MM_match_fields = array() |
Definition at line 154 of file RelationHandler.php.
Referenced by RelationHandler\start().
$MM_oppositeField = '' |
Definition at line 110 of file RelationHandler.php.
Referenced by RelationHandler\start().
$MM_oppositeFieldConf = '' |
Definition at line 124 of file RelationHandler.php.
$MM_oppositeTable = '' |
Definition at line 117 of file RelationHandler.php.
Referenced by RelationHandler\readMM(), and RelationHandler\start().
|
protected |
Definition at line 182 of file RelationHandler.php.
$MM_table_where = '' |
Definition at line 175 of file RelationHandler.php.
$nonTableArray = array() |
Definition at line 64 of file RelationHandler.php.
|
protected |
Definition at line 207 of file RelationHandler.php.
Referenced by RelationHandler\isPurged().
$registerNonTableValues = false |
Definition at line 42 of file RelationHandler.php.
$results = array() |
Definition at line 214 of file RelationHandler.php.
Referenced by RelationHandler\getFromDB().
$secondTable = '' |
Definition at line 95 of file RelationHandler.php.
$tableArray = array() |
Definition at line 50 of file RelationHandler.php.
$undeleteRecord |
Definition at line 146 of file RelationHandler.php.
Referenced by RelationHandler\readForeignField().
|
protected |
Definition at line 187 of file RelationHandler.php.
Referenced by RelationHandler\setUpdateReferenceIndex().
|
protected |
Definition at line 192 of file RelationHandler.php.
Referenced by RelationHandler\setUseLiveParentIds().
|
protected |
Definition at line 197 of file RelationHandler.php.
Referenced by RelationHandler\setUseLiveReferenceIds().
|
protected |
Definition at line 202 of file RelationHandler.php.
Referenced by RelationHandler\getWorkspaceId(), RelationHandler\purgeItemArray(), and RelationHandler\setWorkspaceId().