TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DataHandler Class Reference

Public Member Functions

 __construct ()
 
 setControl (array $control)
 
 start ($data, $cmd, $altUserObject=null)
 
 setMirror ($mirror)
 
 setDefaultsFromUserTS ($userTS)
 
 process_uploads ($postFiles)
 
 process_uploads_traverseArray (&$outputArr, $inputArr, $keyToSet)
 
 hook_processDatamap_afterDatabaseOperations (&$hookObjectsArr, &$status, &$table, &$id, &$fieldArray)
 
 placeholderShadowing ($table, $id)
 
 getPlaceholderTitleForTableLabel ($table, $placeholderContent=null)
 
 fillInFieldArray ($table, $id, $fieldArray, $incomingFieldArray, $realPid, $status, $tscPID)
 
 checkValue ($table, $field, $value, $id, $status, $realPid, $tscPID)
 
 checkValue_SW ($res, $value, $tcaFieldConf, $table, $id, $curValue, $status, $realPid, $recFID, $field, $uploadedFiles, $tscPID, array $additionalData=null)
 
 checkValue_text ($res, $value, $tcaFieldConf, $PP, $field= '')
 
 checkValue_input ($res, $value, $tcaFieldConf, $PP, $field= '')
 
 checkValue_check ($res, $value, $tcaFieldConf, $PP, $field= '')
 
 checkValue_radio ($res, $value, $tcaFieldConf, $PP)
 
 checkValue_group_select ($res, $value, $tcaFieldConf, $PP, $uploadedFiles, $field)
 
 checkValue_flex ($res, $value, $tcaFieldConf, $PP, $uploadedFiles, $field)
 
 checkValue_inline ($res, $value, $tcaFieldConf, $PP, $field, array $additionalData=null)
 
 checkValueForInline ($res, $value, $tcaFieldConf, $table, $id, $status, $field, array $additionalData=null)
 
 checkValue_checkMax ($tcaFieldConf, $valueArray)
 
 getUnique ($table, $field, $value, $id, $newPid=0)
 
 getRecordsWithSameValue ($tableName, $uid, $fieldName, $value, $pageId=0)
 
 checkValue_text_Eval ($value, $evalArray, $is_in)
 
 checkValue_input_Eval ($value, $evalArray, $is_in)
 
 checkValue_group_select_explodeSelectGroupValue ($value)
 
 checkValue_flex_procInData ($dataPart, $dataPart_current, $uploadedFiles, $dataStructArray, $pParams, $callBackFunc= '')
 
 checkValue_flex_procInData_travDS (&$dataValues, $dataValues_current, $uploadedFiles, $DSelements, $pParams, $callBackFunc, $structurePath)
 
 copyPages ($uid, $destPid)
 
 copySpecificPage ($uid, $destPid, $copyTablesArray, $first=false)
 
 copyRecord_raw ($table, $uid, $pid, $overrideArray=array(), array $workspaceOptions=array())
 
 insertNewCopyVersion ($table, $fieldArray, $realPid)
 
 copyRecord_procBasedOnFieldType ($table, $uid, $field, $value, $row, $conf, $realDestPid, $language=0, array $workspaceOptions=array())
 
 copyRecord_flexFormCallBack ($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2)
 
 copyL10nOverlayRecords ($table, $uid, $destPid, $first=false, $overrideValues=array(), $excludeFields= '')
 
 moveRecord ($table, $uid, $destPid)
 
 moveRecord_raw ($table, $uid, $destPid)
 
 moveRecord_procFields ($table, $uid, $destPid)
 
 moveRecord_procBasedOnFieldType ($table, $uid, $destPid, $field, $value, $conf)
 
 moveL10nOverlayRecords ($table, $uid, $destPid, $originalRecordDestinationPid)
 
 deleteAction ($table, $id)
 
 deleteEl ($table, $uid, $noRecordCheck=false, $forceHardDelete=false)
 
 deleteVersionsForRecord ($table, $uid, $forceHardDelete)
 
 undeleteRecord ($table, $uid)
 
 deleteRecord ($table, $uid, $noRecordCheck=false, $forceHardDelete=false, $undeleteRecord=false)
 
 deleteSpecificPage ($uid, $forceHardDelete=false)
 
 canDeletePage ($uid)
 
 cannotDeleteRecord ($table, $id)
 
 isRecordUndeletable ($table, $uid)
 
 deleteRecord_procFields ($table, $uid, $undeleteRecord=false)
 
 deleteL10nOverlayRecords ($table, $uid)
 
 versionizeRecord ($table, $id, $label, $delete=false)
 
 version_remapMMForVersionSwap_execSwap ($table, $id, $swapWith)
 
 remapListedDBRecords ()
 
 remapListedDBRecords_flexFormCallBack ($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2)
 
 remapListedDBRecords_procDBRefs ($conf, $value, $MM_localUid, $table)
 
 processRemapStack ()
 
 addRemapAction ($table, $id, array $callback, array $arguments)
 
 addRemapStackRefIndex ($table, $id)
 
 getVersionizedIncomingFieldArray ($table, $id, &$incomingFieldArray, &$registerDBList)
 
 isRecordInWebMount ($table, $id)
 
 isInWebMount ($pid)
 
 checkRecordUpdateAccess ($table, $id, $data=false, $hookObjectsArr=null)
 
 checkRecordInsertAccess ($insertTable, $pid, $action=1)
 
 isTableAllowedForThisPage ($page_uid, $checkTable)
 
 doesRecordExist ($table, $id, $perms)
 
 doesRecordExist_pageLookUp ($id, $perms)
 
 doesBranchExist ($inList, $pid, $perms, $recurse)
 
 tableReadOnly ($table)
 
 tableAdminOnly ($table)
 
 destNotInsideSelf ($destinationId, $id)
 
 getExcludeListArray ()
 
 doesPageHaveUnallowedTables ($page_uid, $doktype)
 
 pageInfo ($id, $field)
 
 recordInfo ($table, $id, $fieldList)
 
 getRecordProperties ($table, $id, $noWSOL=false)
 
 getRecordPropertiesFromRow ($table, $row)
 
 eventPid ($table, $uid, $pid)
 
 updateDB ($table, $id, $fieldArray)
 
 insertDB ($table, $id, $fieldArray, $newVersion=false, $suggestedUid=0, $dontSetNewIdIndex=false)
 
 checkStoredRecord ($table, $id, $fieldArray, $action)
 
 setHistory ($table, $id, $logId)
 
 getSortNumber ($table, $uid, $pid)
 
 resorting ($table, $pid, $sortRow, $return_SortNumber_After_This_Uid)
 
 setTSconfigPermissions ($fieldArray, $TSConfig_p)
 
 newFieldArray ($table)
 
 addDefaultPermittedLanguageIfNotSet ($table, &$incomingFieldArray)
 
 overrideFieldArray ($table, $data)
 
 compareFieldArrayWithCurrentAndUnset ($table, $id, $fieldArray)
 
 assemblePermissions ($string)
 
 rmComma ($input)
 
 convNumEntityToByteValue ($input)
 
 destPathFromUploadFolder ($folder)
 
 disableDeleteClause ()
 
 deleteClause ($table)
 
 getTCEMAIN_TSconfig ($tscPID)
 
 getTableEntries ($table, $TSconfig)
 
 getPID ($table, $uid)
 
 dbAnalysisStoreExec ()
 
 removeRegisteredFiles ()
 
 int_pageTreeInfo ($CPtable, $pid, $counter, $rootID)
 
 compileAdminTables ()
 
 fixUniqueInPid ($table, $uid)
 
 fixCopyAfterDuplFields ($table, $uid, $prevUid, $update, $newData=array())
 
 extFileFields ($table)
 
 isReferenceField ($conf)
 
 getInlineFieldType ($conf)
 
 getCopyHeader ($table, $pid, $field, $value, $count, $prevTitle= '')
 
 prependLabel ($table)
 
 resolvePid ($table, $pid)
 
 clearPrefixFromValue ($table, $value)
 
 extFileFunctions ($table, $field, $filelist, $func)
 
 noRecordsFromUnallowedTables ($inList)
 
 isRecordCopied ($table, $uid)
 
 registerRecordIdForPageCacheClearing ($table, $uid)
 
 clear_cacheCmd ($cacheCmd)
 
 log ($table, $recuid, $action, $recpid, $error, $details, $details_nr=-1, $data=array(), $event_pid=-1, $NEWid= '')
 
 newlog ($message, $error=0)
 
 newlog2 ($message, $table, $uid, $pid=null, $error=0)
 
 insertUpdateDB_preprocessBasedOnFieldType ($table, $fieldArray)
 
 getAutoVersionId ($table, $id)
 
 isOuterMostInstance ()
 

Public Attributes

 $storeLogMessages = true
 
 $enableLogging = true
 
 $reverseOrder = false
 
 $checkSimilar = true
 
 $stripslashes_values = true
 
 $checkStoredRecords = true
 
 $checkStoredRecords_loose = true
 
 $deleteTree = false
 
 $neverHideAtCopy = false
 
 $isImporting = false
 
 $dontProcessTransformations = false
 
 $clear_flexFormData_vDEFbase = false
 
 $updateModeL10NdiffData = true
 
 $updateModeL10NdiffDataClear = false
 
 $bypassWorkspaceRestrictions = false
 
 $bypassFileHandling = false
 
 $bypassAccessCheckForRecords = false
 
 $copyWhichTables = '*'
 
 $copyTree = 0
 
 $defaultValues = array()
 
 $overrideValues = array()
 
 $alternativeFileName = array()
 
 $alternativeFilePath = array()
 
 $data_disableFields = array()
 
 $suggestedInsertUids = array()
 
 $callBackObj
 
 $autoVersionIdMap = array()
 
 $substNEWwithIDs = array()
 
 $substNEWwithIDs_table = array()
 
 $newRelatedIDs = array()
 
 $copyMappingArray_merged = array()
 
 $copiedFileMap = array()
 
 $RTEmagic_copyIndex = array()
 
 $errorLog = array()
 
 $pagetreeRefreshFieldsFromPages = array('pid', 'sorting', 'deleted', 'hidden', 'title', 'doktype', 'is_siteroot', 'fe_group', 'nav_hide', 'nav_title', 'module', 'starttime', 'endtime', 'content_from_pid')
 
 $pagetreeNeedsRefresh = false
 
 $BE_USER
 
 $userid
 
 $username
 
 $admin
 
 $defaultPermissions
 
 $include_filefunctions
 
 $datamap = array()
 
 $cmdmap = array()
 
 $pMap
 
 $sortIntervals = 256
 
 $recUpdateAccessCache = array()
 
 $recInsertAccessCache = array()
 
 $isRecordInWebMount_Cache = array()
 
 $isInWebMount_Cache = array()
 
 $cachedTSconfig = array()
 
 $pageCache = array()
 
 $checkWorkspaceCache = array()
 
 $dbAnalysisStore = array()
 
 $removeFilesStore = array()
 
 $uploadedFileArray = array()
 
 $registerDBList = array()
 
 $registerDBPids = array()
 
 $copyMappingArray = array()
 
 $remapStack = array()
 
 $remapStackRecords = array()
 
 $updateRefIndexStack = array()
 
 $callFromImpExp = false
 
 $newIndexMap = array()
 
 $fileFunc
 
 $checkValue_currentRecord = array()
 
 $autoVersioningUpdate = false
 

Protected Member Functions

 getCheckModifyAccessListHookObjects ()
 
 transformRichtextContentToDatabase ($value, $table, $field, $defaultExtras, $thisConfig, $pid)
 
 checkValueForText ($value, $tcaFieldConf)
 
 checkValueForInput ($value, $tcaFieldConf, $table, $id, $realPid, $field)
 
 checkValueForCheck ($res, $value, $tcaFieldConf, $table, $id, $realPid, $field)
 
 checkValueForRadio ($res, $value, $tcaFieldConf, $table, $id, $pid, $field)
 
 checkValueForGroupSelect ($res, $value, $tcaFieldConf, $table, $id, $curValue, $status, $recFID, $uploadedFiles, $field)
 
 applyFiltersToValues (array $tcaFieldConfiguration, array $values)
 
 checkValueForFlex ($res, $value, $tcaFieldConf, $table, $id, $curValue, $status, $realPid, $recFID, $tscPID, $uploadedFiles, $field)
 
 _ACTION_FLEX_FORMdata (&$valueArray, $actionCMDs)
 
 getLocalTCE ($stripslashesValues=false, $dontProcessTransformations=true)
 
 updateFlexFormData ($flexFormId, array $modifications)
 
 triggerRemapAction ($table, $id, array $callback, array $arguments, $forceRemapStackActions=false)
 
 getPreviousLocalizedRecordUid ($table, $uid, $pid, $language)
 
 isSubmittedValueEqualToStoredValue ($submittedValue, $storedValue, $storedType, $allowNull=false)
 
 castReferenceValue ($value, array $configuration)
 
 overlayAutoVersionId ($table, $id)
 
 addNewValuesToRemapStackChildIds (array $idValues)
 
 getOuterMostInstance ()
 
 getRuntimeCache ()
 
 isNestedElementCallRegistered ($table, $id, $identifier)
 
 registerNestedElementCall ($table, $id, $identifier)
 
 resetNestedElementCalls ()
 
 isElementToBeDeleted ($table, $id)
 
 registerElementsToBeDeleted ()
 
 resetElementsToBeDeleted ()
 
 unsetElementsToBeDeleted (array $elements)
 
 getCommandMapElements ($needle)
 
 controlActiveElements ()
 
 setNullValues (array $active, array &$haystack)
 
 getFieldEvalCacheIdentifier ($additionalIdentifier)
 
 createRelationHandlerInstance ()
 
 getCacheManager ()
 
 getResourceFactory ()
 

Protected Attributes

 $excludedTablesAndFields = array()
 
 $control = array()
 
 $mmHistoryRecords = array()
 
 $historyRecords = array()
 
 $remapStackChildIds = array()
 
 $remapStackActions = array()
 
 $remapStackRefIndex = array()
 
 $disableDeleteClause = false
 
 $checkModifyAccessListHookObjects
 
 $version_remapMMForVersionSwap_reg
 
 $outerMostInstance = null
 
 $databaseConnection
 
 $runtimeCache = null
 
 $cachePrefixNestedElementCalls = 'core-datahandler-nestedElementCalls-'
 

Static Protected Attributes

static $recordsToClearCacheFor = array()
 

Detailed Description

The main data handler class which takes care of correctly updating and inserting records. This class was formerly known as TCEmain.

This is the TYPO3 Core Engine class for manipulation of the database This class is used by eg. the tce_db.php script which provides an the interface for POST forms to this class.

Dependencies:

tce_db.php for further comments and SYNTAX! Also see document 'TYPO3 Core API' for details.

Definition at line 51 of file DataHandler.php.

Constructor & Destructor Documentation

__construct ( )

Definition at line 697 of file DataHandler.php.

References $GLOBALS, and DataHandler\getRuntimeCache().

Member Function Documentation

_ACTION_FLEX_FORMdata ( $valueArray,
  $actionCMDs 
)
protected

Actions for flex form element (move, delete) allows to remove and move flexform sections

Parameters
array$valueArrayby reference
array$actionCMDs

Definition at line 2552 of file DataHandler.php.

References elseif.

Referenced by DataHandler\checkValueForFlex().

addDefaultPermittedLanguageIfNotSet (   $table,
$incomingFieldArray 
)

If a "languageField" is specified for $table this function will add a possible value to the incoming array if none is found in there already.

Parameters
string$tableTable name
array$incomingFieldArrayIncoming array (passed by reference)
Returns
void

Definition at line 6974 of file DataHandler.php.

References BackendUtility\deleteClause().

addNewValuesToRemapStackChildIds ( array  $idValues)
protected

Adds new values to the remapStackChildIds array.

Parameters
array$idValuesuid values
Returns
void

Definition at line 8011 of file DataHandler.php.

Referenced by DataHandler\checkValueForGroupSelect(), and DataHandler\checkValueForInline().

addRemapAction (   $table,
  $id,
array  $callback,
array  $arguments 
)

Adds an instruction to the remap action stack (used with IRRE).

Parameters
string$tableThe affected table
int$idThe affected ID
array$callbackThe callback information (object and method)
array$argumentsThe arguments to be used with the callback
Returns
void

Definition at line 5955 of file DataHandler.php.

Referenced by DataHandler\triggerRemapAction(), and DataHandlerHook\version_swap_processFields().

addRemapStackRefIndex (   $table,
  $id 
)

Adds a table-id-pair to the reference index remapping stack.

Parameters
string$table
int$id
Returns
void

Definition at line 5974 of file DataHandler.php.

applyFiltersToValues ( array  $tcaFieldConfiguration,
array  $values 
)
protected

Applies the filter methods from a column's TCA configuration to a value array.

Parameters
array$tcaFieldConfiguration
array$values
Returns
array|mixed
Exceptions
\RuntimeException

Definition at line 2131 of file DataHandler.php.

References GeneralUtility\callUserFunction().

Referenced by DataHandler\checkValueForGroupSelect().

assemblePermissions (   $string)

Calculates the bitvalue of the permissions given in a string, comma-separated

Parameters
string$stringList of pMap strings
Returns
int Integer mask
See Also
setTSconfigPermissions(), newFieldArray()

Definition at line 7101 of file DataHandler.php.

References GeneralUtility\trimExplode().

Referenced by DataHandler\newFieldArray(), and DataHandler\setTSconfigPermissions().

canDeletePage (   $uid)

Used to evaluate if a page can be deleted

Parameters
int$uidPage id
Returns
array|string If array: List of page uids to traverse and delete (means OK), if string: error message.

Definition at line 5109 of file DataHandler.php.

References DataHandler\doesBranchExist(), DataHandler\doesRecordExist(), DataHandler\noRecordsFromUnallowedTables(), and GeneralUtility\trimExplode().

Referenced by DataHandler\cannotDeleteRecord().

cannotDeleteRecord (   $table,
  $id 
)

Returns TRUE if record CANNOT be deleted, otherwise FALSE. Used to check before the versioning API allows a record to be marked for deletion.

Parameters
string$tableRecord Table
int$idRecord UID
Returns
string Returns a string IF there is an error (error string explaining). FALSE means record can be deleted

Definition at line 5162 of file DataHandler.php.

References DataHandler\canDeletePage(), and DataHandler\doesRecordExist().

Referenced by DataHandler\versionizeRecord().

castReferenceValue (   $value,
array  $configuration 
)
protected

Casts a reference value. In case MM relations or foreign_field references are used. All other configurations, as well as foreign_table(!) could be stored as comma-separated-values as well. Since the system is not able to determine the default value automatically then, the TCA default value is used if it has been defined.

Parameters
int | string$valueThe value to be casted (e.g. '', '0', '1,2,3')
array$configurationThe TCA configuration of the accordant field
Returns
int|string

Definition at line 7392 of file DataHandler.php.

Referenced by DataHandler\checkValueForGroupSelect(), and DataHandler\processRemapStack().

checkRecordInsertAccess (   $insertTable,
  $pid,
  $action = 1 
)

Checks if user may insert a record from $insertTable on $pid Does not check for workspace, use BE_USER->workspaceAllowLiveRecordsInPID for this in addition to this function call.

Parameters
string$insertTableTablename to check
int$pidInteger PID
int$actionFor logging: Action number.
Returns
bool Returns TRUE if the user may insert a record from table $insertTable on page $pid

Definition at line 6113 of file DataHandler.php.

References DataHandler\doesRecordExist(), elseif, DataHandler\getRecordProperties(), BackendUtility\isRootLevelRestrictionIgnored(), DataHandler\isTableAllowedForThisPage(), and DataHandler\log().

Referenced by DataHandler\moveRecord().

checkRecordUpdateAccess (   $table,
  $id,
  $data = false,
  $hookObjectsArr = null 
)

Checks if user may update a record with uid=$id from $table

Parameters
string$tableRecord table
int$idRecord UID
array | bool$dataRecord data
array$hookObjectsArrHook objects
Returns
bool Returns TRUE if the user may update the record given by $table and $id

Definition at line 6076 of file DataHandler.php.

References DataHandler\doesRecordExist(), and elseif.

Referenced by DataHandler\moveRecord(), DataHandlerHook\version_clearWSID(), and DataHandlerHook\version_setStage().

checkStoredRecord (   $table,
  $id,
  $fieldArray,
  $action 
)

Checking stored record to see if the written values are properly updated.

Parameters
string$tableRecord table name
int$idRecord uid
array$fieldArrayArray of field=>value pairs to insert/update
string$actionAction, for logging only.
Returns
array|NULL Selected row
See Also
insertDB(), updateDB()

Definition at line 6659 of file DataHandler.php.

References elseif, and DataHandler\log().

Referenced by DataHandler\insertDB(), and DataHandler\updateDB().

checkValue (   $table,
  $field,
  $value,
  $id,
  $status,
  $realPid,
  $tscPID 
)

Evaluates a value according to $table/$field settings. This function is for real database fields - NOT FlexForm "pseudo" fields. NOTICE: Calling this function expects this: 1) That the data is saved! (files are copied and so on) 2) That files registered for deletion IS deleted at the end (with ->removeRegisteredFiles() )

Parameters
string$tableTable name
string$fieldField name
string$valueValue to be evaluated. Notice, this is the INPUT value from the form. The original value (from any existing record) must be manually looked up inside the function if needed - or taken from $currentRecord array.
string$idThe record-uid, mainly - but not exclusively - used for logging
string$status'update' or 'new' flag
int$realPidThe real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted. If $realPid is -1 it means that a new version of the record is being inserted.
int$tscPIDTSconfig PID
Returns
array Returns the evaluated $value as key "value" in this array. Can be checked with isset($res['value']) ...

Definition at line 1625 of file DataHandler.php.

References DataHandler\checkValue_SW(), DataHandler\doesPageHaveUnallowedTables(), DataHandler\getRecordProperties(), GeneralUtility\inList(), DataHandler\log(), and DataHandler\recordInfo().

Referenced by DataHandler\fillInFieldArray(), and DataHandler\insertNewCopyVersion().

checkValue_check (   $res,
  $value,
  $tcaFieldConf,
  $PP,
  $field = '' 
)

Evaluates 'check' type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
array$PPAdditional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
string$fieldField name
Returns
array Modified $res array
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 1893 of file DataHandler.php.

References DataHandler\checkValueForCheck(), and GeneralUtility\logDeprecatedFunction().

checkValue_checkMax (   $tcaFieldConf,
  $valueArray 
)

Checks if a fields has more items than defined via TCA in maxitems. If there are more items than allowd, the item list is truncated to the defined number.

Parameters
array$tcaFieldConfField configuration from TCA
array$valueArrayCurrent value array of items
Returns
array The truncated value array of items

Definition at line 2654 of file DataHandler.php.

Referenced by DataHandler\checkValueForGroupSelect(), and DataHandler\processRemapStack().

checkValue_flex (   $res,
  $value,
  $tcaFieldConf,
  $PP,
  $uploadedFiles,
  $field 
)

Evaluates 'flex' type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string | array$valueThe value to set.
array$tcaFieldConfField configuration from TCA
array$PPAdditional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
array$uploadedFilesUploaded files for the field
string$fieldField name
Returns
array Modified $res array
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 2448 of file DataHandler.php.

References DataHandler\checkValueForFlex(), and GeneralUtility\logDeprecatedFunction().

checkValue_flex_procInData (   $dataPart,
  $dataPart_current,
  $uploadedFiles,
  $dataStructArray,
  $pParams,
  $callBackFunc = '' 
)

Starts the processing the input data for flexforms. This will traverse all sheets / languages and for each it will traverse the sub-structure. See checkValue_flex_procInData_travDS() for more details. WARNING: Currently, it traverses based on the actual data array and NOT the structure. This means that values for non-valid fields, lKey/vKey/sKeys will be accepted! For traversal of data with a call back function you should rather use

Parameters
array$dataPartThe 'data' part of the INPUT flexform data
array$dataPart_currentThe 'data' part of the CURRENT flexform data
array$uploadedFilesThe uploaded files for the 'data' part of the INPUT flexform data
array$dataStructArrayData structure for the form (might be sheets or not). Only values in the data array which has a configuration in the data structure will be processed.
array$pParamsA set of parameters to pass through for the calling of the evaluation functions
string$callBackFuncOptional call back function, see checkValue_flex_procInData_travDS() DEPRECATED, use instead for traversal!
Returns
array The modified 'data' part.
See Also
checkValue_flex_procInData_travDS()

Definition at line 3007 of file DataHandler.php.

References DataHandler\checkValue_flex_procInData_travDS(), and GeneralUtility\resolveSheetDefInDS().

Referenced by DataHandler\checkValueForFlex(), DataHandler\copyRecord_procBasedOnFieldType(), and DataHandler\remapListedDBRecords().

checkValue_flex_procInData_travDS ( $dataValues,
  $dataValues_current,
  $uploadedFiles,
  $DSelements,
  $pParams,
  $callBackFunc,
  $structurePath 
)

Processing of the sheet/language data array When it finds a field with a value the processing is done by ->checkValue_SW() by default but if a call back function name is given that method in this class will be called for the processing instead.

Parameters
array$dataValuesNew values (those being processed): Multidimensional Data array for sheet/language, passed by reference!
array$dataValues_currentCurrent values: Multidimensional Data array. May be empty array() if not needed (for callBackFunctions)
array$uploadedFilesUploaded files array for sheet/language. May be empty array() if not needed (for callBackFunctions)
array$DSelementsData structure which fits the data array
array$pParamsA set of parameters to pass through for the calling of the evaluation functions / call back function
string$callBackFuncCall back function, default is checkValue_SW(). If $this->callBackObj is set to an object, the callback function in that object is called instead.
string$structurePath
Returns
void
See Also
checkValue_flex_procInData()

Definition at line 3036 of file DataHandler.php.

References DataHandler\checkValue_SW(), elseif, BackendUtility\getPagesTSconfig(), BackendUtility\getSpecConfParts(), BackendUtility\getTCAtypeValue(), BackendUtility\RTEsetup(), and DataHandler\transformRichtextContentToDatabase().

Referenced by DataHandler\checkValue_flex_procInData().

checkValue_group_select (   $res,
  $value,
  $tcaFieldConf,
  $PP,
  $uploadedFiles,
  $field 
)

Evaluates 'group' or 'select' type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
array$PPAdditional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
array$uploadedFiles
string$fieldField name
Returns
array Modified $res array
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 2020 of file DataHandler.php.

References DataHandler\checkValueForGroupSelect(), and GeneralUtility\logDeprecatedFunction().

checkValue_group_select_explodeSelectGroupValue (   $value)

Explodes the $value, which is a list of files/uids (group select)

Parameters
string$valueInput string, comma separated values. For each part it will also be detected if a '|' is found and the first part will then be used if that is the case. Further the value will be rawurldecoded.
Returns
array The value array.

Definition at line 2982 of file DataHandler.php.

References GeneralUtility\trimExplode().

Referenced by DataHandler\checkValueForGroupSelect().

checkValue_inline (   $res,
  $value,
  $tcaFieldConf,
  $PP,
  $field,
array  $additionalData = null 
)

Evaluates 'inline' type values. (partly copied from the select_group function on this issue)

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
array$PPAdditional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
string$fieldField name
array$additionalDataAdditional data to be forwarded to sub-processors
Returns
array Modified $res array

Definition at line 2596 of file DataHandler.php.

References DataHandler\checkValueForInline().

checkValue_input (   $res,
  $value,
  $tcaFieldConf,
  $PP,
  $field = '' 
)

Evaluate "input" type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the "value" key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
array$PPAdditional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
string$fieldField name
Returns
array Modified $res array
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 1798 of file DataHandler.php.

References DataHandler\checkValueForInput(), and GeneralUtility\logDeprecatedFunction().

checkValue_input_Eval (   $value,
  $evalArray,
  $is_in 
)

Evaluation of 'input'-type values based on 'eval' list

Parameters
string$valueValue to evaluate
array$evalArrayArray of evaluations to traverse.
string$is_inIs-in string for 'is_in' evaluation
Returns
array Modified $value in key 'value' or empty array

Definition at line 2792 of file DataHandler.php.

References GeneralUtility\idnaEncode(), and GeneralUtility\makeInstance().

Referenced by DataHandler\checkValueForInput(), and DataHandler\getPlaceholderTitleForTableLabel().

checkValue_radio (   $res,
  $value,
  $tcaFieldConf,
  $PP 
)

Evaluates 'radio' type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
array$PPAdditional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
Returns
array Modified $res array
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 1961 of file DataHandler.php.

References DataHandler\checkValueForRadio(), and GeneralUtility\logDeprecatedFunction().

checkValue_SW (   $res,
  $value,
  $tcaFieldConf,
  $table,
  $id,
  $curValue,
  $status,
  $realPid,
  $recFID,
  $field,
  $uploadedFiles,
  $tscPID,
array  $additionalData = null 
)

Branches out evaluation of a field value based on its type as configured in $GLOBALS['TCA'] Can be called for FlexForm pseudo fields as well, BUT must not have $field set if so.

Parameters
array$resThe result array. The processed value (if any!) is set in the "value" key.
string$valueThe value to set.
array$tcaFieldConfField configuration from $GLOBALS['TCA']
string$tableTable name
int$idUID of record
mixed$curValueCurrent value of the field
string$status'update' or 'new' flag
int$realPidThe real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted. If $realPid is -1 it means that a new version of the record is being inserted.
string$recFIDField identifier [table:uid:field] for flexforms
string$fieldField name. Must NOT be set if the call is for a flexform field (since flexforms are not allowed within flexforms).
array$uploadedFiles
int$tscPIDTSconfig PID
array$additionalDataAdditional data to be forwarded to sub-processors
Returns
array Returns the evaluated $value as key "value" in this array.

Definition at line 1703 of file DataHandler.php.

References DataHandler\checkValueForCheck(), DataHandler\checkValueForFlex(), DataHandler\checkValueForGroupSelect(), DataHandler\checkValueForInline(), DataHandler\checkValueForInput(), DataHandler\checkValueForRadio(), DataHandler\checkValueForText(), and GeneralUtility\inList().

Referenced by DataHandler\checkValue(), and DataHandler\checkValue_flex_procInData_travDS().

checkValue_text (   $res,
  $value,
  $tcaFieldConf,
  $PP,
  $field = '' 
)

Evaluate "text" type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the "value" key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
array$PPAdditional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
string$fieldField name
Returns
array Modified $res array
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 1759 of file DataHandler.php.

References DataHandler\checkValueForText(), and GeneralUtility\logDeprecatedFunction().

checkValue_text_Eval (   $value,
  $evalArray,
  $is_in 
)
Parameters
string$valueThe field value to be evaluated
array$evalArrayArray of evaluations to traverse.
string$is_inThe "is_in" value of the field configuration from TCA
Returns
array

Definition at line 2753 of file DataHandler.php.

References GeneralUtility\makeInstance().

Referenced by DataHandler\checkValueForText().

checkValueForCheck (   $res,
  $value,
  $tcaFieldConf,
  $table,
  $id,
  $realPid,
  $field 
)
protected

Evaluates 'check' type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
string$tableTable name
int$idUID of record
int$realPidThe real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted. If $realPid is -1 it means that a new version of the record is being inserted.
string$fieldField name
Returns
array Modified $res array

Definition at line 1912 of file DataHandler.php.

References BackendUtility\getItemLabel(), DataHandler\getRecordsWithSameValue(), DataHandler\log(), and GeneralUtility\trimExplode().

Referenced by DataHandler\checkValue_check(), and DataHandler\checkValue_SW().

checkValueForFlex (   $res,
  $value,
  $tcaFieldConf,
  $table,
  $id,
  $curValue,
  $status,
  $realPid,
  $recFID,
  $tscPID,
  $uploadedFiles,
  $field 
)
protected

Evaluates 'flex' type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string | array$valueThe value to set.
array$tcaFieldConfField configuration from TCA
string$tableTable name
int$idUID of record
mixed$curValueCurrent value of the field
string$status'update' or 'new' flag
int$realPidThe real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted. If $realPid is -1 it means that a new version of the record is being inserted.
string$recFIDField identifier [table:uid:field] for flexforms
int$tscPIDTSconfig PID
array$uploadedFilesUploaded files for the field
string$fieldField name
Returns
array Modified $res array

Definition at line 2472 of file DataHandler.php.

References DataHandler\_ACTION_FLEX_FORMdata(), GeneralUtility\_GP(), DataHandler\checkValue_flex_procInData(), BackendUtility\getFlexFormDS(), GeneralUtility\getUserObj(), ArrayUtility\mergeRecursiveWithOverrule(), and GeneralUtility\xml2array().

Referenced by DataHandler\checkValue_flex(), and DataHandler\checkValue_SW().

checkValueForGroupSelect (   $res,
  $value,
  $tcaFieldConf,
  $table,
  $id,
  $curValue,
  $status,
  $recFID,
  $uploadedFiles,
  $field 
)
protected

Evaluates 'group' or 'select' type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
string$tableTable name
int$idUID of record
mixed$curValueCurrent value of the field
string$status'update' or 'new' flag
string$recFIDField identifier [table:uid:field] for flexforms
array$uploadedFiles
string$fieldField name
Returns
array Modified $res array

Definition at line 2042 of file DataHandler.php.

References DataHandler\addNewValuesToRemapStackChildIds(), DataHandler\applyFiltersToValues(), DataHandler\castReferenceValue(), DataHandler\checkValue_checkMax(), DataHandler\checkValue_group_select_explodeSelectGroupValue(), DataHandler\convNumEntityToByteValue(), and GeneralUtility\trimExplode().

Referenced by DataHandler\checkValue_group_select(), and DataHandler\checkValue_SW().

checkValueForInline (   $res,
  $value,
  $tcaFieldConf,
  $table,
  $id,
  $status,
  $field,
array  $additionalData = null 
)

Evaluates 'inline' type values. (partly copied from the select_group function on this issue)

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
string$tableTable name
int$idUID of record
string$status'update' or 'new' flag
string$fieldField name
array$additionalDataAdditional data to be forwarded to sub-processors
Returns
array Modified $res array

Definition at line 2616 of file DataHandler.php.

References DataHandler\addNewValuesToRemapStackChildIds(), MathUtility\canBeInterpretedAsInteger(), elseif, and GeneralUtility\trimExplode().

Referenced by DataHandler\checkValue_inline(), and DataHandler\checkValue_SW().

checkValueForInput (   $value,
  $tcaFieldConf,
  $table,
  $id,
  $realPid,
  $field 
)
protected

Evaluate "input" type values.

Parameters
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
string$tableTable name
int$idUID of record
int$realPidThe real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted. If $realPid is -1 it means that a new version of the record is being inserted.
string$fieldField name
Returns
array $res The result array. The processed value (if any!) is set in the "value" key.

Definition at line 1816 of file DataHandler.php.

References DataHandler\checkValue_input_Eval(), DataHandler\getFieldEvalCacheIdentifier(), DataHandler\getUnique(), and GeneralUtility\trimExplode().

Referenced by DataHandler\checkValue_input(), and DataHandler\checkValue_SW().

checkValueForRadio (   $res,
  $value,
  $tcaFieldConf,
  $table,
  $id,
  $pid,
  $field 
)
protected

Evaluates 'radio' type values.

Parameters
array$resThe result array. The processed value (if any!) is set in the 'value' key.
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
array$tableThe table of the record
int$idThe id of the record
int$pidThe pid of the record
string$fieldThe field to check
Returns
array Modified $res array

Definition at line 1980 of file DataHandler.php.

References GeneralUtility\makeInstance().

Referenced by DataHandler\checkValue_radio(), and DataHandler\checkValue_SW().

checkValueForText (   $value,
  $tcaFieldConf 
)
protected

Evaluate "text" type values.

Parameters
string$valueThe value to set.
array$tcaFieldConfField configuration from TCA
Returns
array $res The result array. The processed value (if any!) is set in the "value" key.

Definition at line 1772 of file DataHandler.php.

References DataHandler\checkValue_text_Eval(), DataHandler\getFieldEvalCacheIdentifier(), and GeneralUtility\trimExplode().

Referenced by DataHandler\checkValue_SW(), and DataHandler\checkValue_text().

clear_cacheCmd (   $cacheCmd)

Clears the cache based on the command $cacheCmd.

$cacheCmd='pages' Clears cache for all pages and page-based caches inside the cache manager. Requires admin-flag to be set for BE_USER.

$cacheCmd='all' Clears all cache_tables. This is necessary if templates are updated. Requires admin-flag to be set for BE_USER.

The following cache_* are intentionally not cleared by 'all'

  • cache_md5params: RDCT redirects.
  • cache_imagesizes: Clearing this table would cause a lot of unneeded Imagemagick calls because the size informations have to be fetched again after clearing.
  • all caches inside the cache manager that are inside the group "system"
  • they are only needed to build up the core system and templates, use "temp_cached" or "system" to do that

$cacheCmd=[integer] Clears cache for the page pointed to by $cacheCmd (an integer).

$cacheCmd='cacheTag:[string]' Flush page and pagesection cache by given tag

$cacheCmd='cacheId:[string]' Removes cache identifier from page and page section cache

Can call a list of post processing functions as defined in $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] (numeric array with values being the function references, called by GeneralUtility::callUserFunction()).

Parameters
string$cacheCmdThe cache command, see above description
Returns
void

Definition at line 7773 of file DataHandler.php.

References GeneralUtility\callUserFunction(), MathUtility\canBeInterpretedAsInteger(), DataHandler\getCacheManager(), and GeneralUtility\isFirstPartOfStr().

clearPrefixFromValue (   $table,
  $value 
)

Removes the prependAtCopy prefix on values

Parameters
string$tableTable name
string$valueThe value to fix
Returns
string Clean name

Definition at line 7524 of file DataHandler.php.

References DataHandler\prependLabel().

compareFieldArrayWithCurrentAndUnset (   $table,
  $id,
  $fieldArray 
)

Compares the incoming field array with the current record and unsets all fields which are the same. Used for existing records being updated

Parameters
string$tableRecord table name
int$idRecord uid
array$fieldArrayArray of field=>value pairs intended to be inserted into the database. All keys with values matching exactly the current value will be unset!
Returns
array Returns $fieldArray. If the returned array is empty, then the record should not be updated!

Definition at line 7015 of file DataHandler.php.

References elseif, GeneralUtility\inList(), and DataHandler\isSubmittedValueEqualToStoredValue().

compileAdminTables ( )

List of all tables (those administrators has access to = array_keys of $GLOBALS['TCA'])

Returns
array Array of all TCA table names

Definition at line 7296 of file DataHandler.php.

Referenced by DataHandler\copyPages().

controlActiveElements ( )
protected

Controls active elements and sets NULL values if not active. Datamap is modified accordant to submitted control values.

Returns
void

Definition at line 8188 of file DataHandler.php.

References DataHandler\setNullValues().

convNumEntityToByteValue (   $input)

Converts a HTML entity (like {) to the character '123'

Parameters
string$inputInput string
Returns
string Output string

Definition at line 7130 of file DataHandler.php.

Referenced by DataHandler\checkValueForGroupSelect().

copyL10nOverlayRecords (   $table,
  $uid,
  $destPid,
  $first = false,
  $overrideValues = array(),
  $excludeFields = '' 
)

Find l10n-overlay records and perform the requested copy action for these records.

Parameters
string$tableRecord Table
string$uidRecord UID
string$destPidPosition to copy to
bool$first
array$overrideValues
string$excludeFields
Returns
void

Definition at line 4106 of file DataHandler.php.

References DataHandler\$overrideValues, BackendUtility\getRecordsByField(), BackendUtility\getTSconfig_pidValue(), and BackendUtility\isTableLocalizable().

copyPages (   $uid,
  $destPid 
)

Copying pages Main function for copying pages.

Parameters
int$uidPage UID to copy
int$destPidDestination PID: >=0 then it points to a page-id on which to insert the record (as the first element). <0 then it points to a uid from its own table after which to insert it (works if
Returns
void

Definition at line 3525 of file DataHandler.php.

References DataHandler\compileAdminTables(), DataHandler\copySpecificPage(), elseif, DataHandler\int_pageTreeInfo(), DataHandler\log(), and GeneralUtility\trimExplode().

copyRecord_flexFormCallBack (   $pParams,
  $dsConf,
  $dataValue,
  $dataValue_ext1,
  $dataValue_ext2 
)

Callback function for traversing the FlexForm structure in relation to creating copied files of file relations inside of flex form structures.

Parameters
array$pParamsArray of parameters in num-indexes: table, uid, field
array$dsConfTCA field configuration (from Data Structure XML)
string$dataValueThe value of the flexForm field
string$dataValue_ext1Not used.
string$dataValue_ext2Not used.
Returns
array Result array with key "value" containing the value of the processing.
See Also
copyRecord(), checkValue_flex_procInData_travDS()

Definition at line 3946 of file DataHandler.php.

References DataHandler\copyRecord_procBasedOnFieldType(), DataHandler\getInlineFieldType(), and DataHandler\isReferenceField().

copyRecord_procBasedOnFieldType (   $table,
  $uid,
  $field,
  $value,
  $row,
  $conf,
  $realDestPid,
  $language = 0,
array  $workspaceOptions = array() 
)

Processing/Preparing content for copyRecord() function

Parameters
string$tableTable name
int$uidRecord uid
string$fieldField name being processed
string$valueInput value to be processed.
array$rowRecord array
array$confTCA field configuration
int$realDestPidReal page id (pid) the record is copied to
int$languageLanguage ID (from sys_language table) used in the duplicated record
array$workspaceOptionsOptions to be forwarded if actions happen on a workspace currently
Returns
array|string private
See Also
copyRecord()

Definition at line 3762 of file DataHandler.php.

References DataHandler\checkValue_flex_procInData(), elseif, BackendUtility\getFlexFormDS(), DataHandler\getInlineFieldType(), BackendUtility\getInlineLocalizationMode(), DataHandler\isReferenceField(), and GeneralUtility\xml2array().

Referenced by DataHandler\copyRecord_flexFormCallBack(), and DataHandler\copyRecord_raw().

copyRecord_raw (   $table,
  $uid,
  $pid,
  $overrideArray = array(),
array  $workspaceOptions = array() 
)

Copying records, but makes a "raw" copy of a record. Basically the only thing observed is field processing like the copying of files and correction of ids. All other fields are 1-1 copied. Technically the copy is made with THIS instance of the tcemain class contrary to copyRecord() which creates a new instance and uses the processData() function. The copy is created by insertNewCopyVersion() which bypasses most of the regular input checking associated with processData() - maybe copyRecord() should even do this as well!? This function is used to create new versions of a record. NOTICE: DOES NOT CHECK PERMISSIONS to create! And since page permissions are just passed through and not changed to the user who executes the copy we cannot enforce permissions without getting an incomplete copy - unless we change permissions of course.

Parameters
string$tableElement table
int$uidElement UID
int$pidElement PID (real PID, not checked)
array$overrideArrayOverride array - must NOT contain any fields not in the table!
array$workspaceOptionsOptions to be forwarded if actions happen on a workspace currently
Returns
int Returns the new ID of the record (if applicable)

Definition at line 3638 of file DataHandler.php.

References DataHandler\copyRecord_procBasedOnFieldType(), DataHandler\dbAnalysisStoreExec(), DataHandler\doesRecordExist(), DataHandler\insertNewCopyVersion(), DataHandler\isElementToBeDeleted(), DataHandler\isRecordCopied(), DataHandler\log(), DataHandler\recordInfo(), and BackendUtility\wsMapId().

Referenced by DataHandlerHook\rawCopyPageContent(), DataHandlerHook\versionizePages(), and DataHandler\versionizeRecord().

copySpecificPage (   $uid,
  $destPid,
  $copyTablesArray,
  $first = false 
)

Copying a single page ($uid) to $destPid and all tables in the array copyTablesArray.

Parameters
int$uidPage uid
int$destPidDestination PID: >=0 then it points to a page-id on which to insert the record (as the first element). <0 then it points to a uid from its own table after which to insert it (works if
array$copyTablesArrayTable on pages to copy along with the page.
bool$firstIs a flag set, if the record copied is NOT a 'slave' to another record copied. That is, if this record was asked to be copied in the cmd-array
Returns
int|NULL The id of the new page, if applicable.

Definition at line 3579 of file DataHandler.php.

References DataHandler\deleteClause(), BackendUtility\isTableLocalizable(), and DataHandler\processRemapStack().

Referenced by DataHandler\copyPages().

createRelationHandlerInstance ( )
protected

function to make the static call to GeneralUtility mockable

Returns
RelationHandler

Definition at line 8240 of file DataHandler.php.

References GeneralUtility\makeInstance().

Referenced by DataHandler\moveRecord_procBasedOnFieldType(), and DataHandler\remapListedDBRecords_procDBRefs().

dbAnalysisStoreExec ( )

Executing dbAnalysisStore This will save MM relations for new records but is executed after records are created because we need to know the ID of them

Returns
void

Definition at line 7237 of file DataHandler.php.

References MathUtility\canBeInterpretedAsInteger(), and BackendUtility\wsMapId().

Referenced by DataHandler\copyRecord_raw().

deleteAction (   $table,
  $id 
)

Delete a single record

Parameters
string$tableTable name
int$idRecord UID
Returns
void

Definition at line 4757 of file DataHandler.php.

References DataHandler\deleteEl(), BackendUtility\getRecord(), and GeneralUtility\getUserObj().

Referenced by DataHandler\deleteL10nOverlayRecords().

deleteClause (   $table)
deleteEl (   $table,
  $uid,
  $noRecordCheck = false,
  $forceHardDelete = false 
)

Delete element from any table

Parameters
string$tableTable name
int$uidRecord UID
bool$noRecordCheckFlag: If $noRecordCheck is set, then the function does not check permission to delete record
bool$forceHardDeleteIf TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
Returns
void

Definition at line 4787 of file DataHandler.php.

References DataHandler\deleteRecord(), and DataHandler\deleteVersionsForRecord().

Referenced by DataHandler\deleteAction(), DataHandler\deleteVersionsForRecord(), DataHandlerHook\processCmdmap_deleteAction(), and DataHandlerHook\version_clearWSID().

deleteL10nOverlayRecords (   $table,
  $uid 
)

Find l10n-overlay records and perform the requested delete action for these records.

Parameters
string$tableRecord Table
string$uidRecord UID
Returns
void

Definition at line 5277 of file DataHandler.php.

References Enumeration\cast(), VersionState\DELETE_PLACEHOLDER, DataHandler\deleteAction(), BackendUtility\getRecordsByField(), BackendUtility\isTableLocalizable(), BackendUtility\isTableWorkspaceEnabled(), and BackendUtility\workspaceOL().

Referenced by DataHandler\deleteRecord(), and DataHandlerHook\processCmdmap_deleteAction().

deleteRecord (   $table,
  $uid,
  $noRecordCheck = false,
  $forceHardDelete = false,
  $undeleteRecord = false 
)

Deleting/Undeleting a record This function may not be used to delete pages-records unless the underlying records are already deleted Deletes a record regardless of versioning state (live or offline, doesn't matter, the uid decides) If both $noRecordCheck and $forceHardDelete are set it could even delete a "deleted"-flagged record!

Parameters
string$tableTable name
int$uidRecord UID
bool$noRecordCheckFlag: If $noRecordCheck is set, then the function does not check permission to delete record
bool$forceHardDeleteIf TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
bool$undeleteRecordIf TRUE, the "deleted" flag is set to 0 again and thus, the item is undeleted.
Returns
void

Definition at line 4855 of file DataHandler.php.

References DataHandler\deleteL10nOverlayRecords(), DataHandler\deleteRecord_procFields(), DataHandler\doesRecordExist(), elseif, DataHandler\extFileFields(), DataHandler\extFileFunctions(), DataHandler\getRecordProperties(), BackendUtility\getRecordRaw(), DataHandler\log(), GeneralUtility\makeInstance(), and DataHandler\registerRecordIdForPageCacheClearing().

Referenced by DataHandler\deleteEl(), DataHandler\deleteSpecificPage(), DataHandler\deleteVersionsForRecord(), and DataHandler\undeleteRecord().

deleteRecord_procFields (   $table,
  $uid,
  $undeleteRecord = false 
)

Before a record is deleted, check if it has references such as inline type or MM references. If so, set these child records also to be deleted.

Parameters
string$tableRecord Table
string$uidRecord UID
bool$undeleteRecordIf a record should be undeleted (e.g. from history/undo)
Returns
void
See Also
deleteRecord()

Definition at line 5208 of file DataHandler.php.

References BackendUtility\getRecord().

Referenced by DataHandler\deleteRecord().

deleteSpecificPage (   $uid,
  $forceHardDelete = false 
)

Delete a page and all records on it.

Parameters
int$uidPage id
bool$forceHardDeleteIf TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
Returns
void private
See Also
deletePages()

Definition at line 5039 of file DataHandler.php.

References DataHandler\deleteClause(), DataHandler\deleteRecord(), and DataHandler\deleteVersionsForRecord().

deleteVersionsForRecord (   $table,
  $uid,
  $forceHardDelete 
)

Delete versions for element from any table

Parameters
string$tableTable name
int$uidRecord UID
bool$forceHardDeleteIf TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
Returns
void

Definition at line 4805 of file DataHandler.php.

References Enumeration\cast(), DataHandler\deleteEl(), DataHandler\deleteRecord(), BackendUtility\getMovePlaceholder(), VersionState\MOVE_POINTER, and BackendUtility\selectVersionsOfRecord().

Referenced by DataHandler\deleteEl(), and DataHandler\deleteSpecificPage().

destNotInsideSelf (   $destinationId,
  $id 
)

Checks if page $id is a uid in the rootline of page id $destinationId Used when moving a page

Parameters
int$destinationIdDestination Page ID to test
int$idPage ID to test for presence inside Destination
Returns
bool Returns FALSE if ID is inside destination (including equal to)

Definition at line 6344 of file DataHandler.php.

References DataHandler\deleteClause(), and BackendUtility\fixVersioningPid().

Referenced by DataHandler\moveRecord_raw().

destPathFromUploadFolder (   $folder)

Returns absolute destination path for the upload folder, $folder

Parameters
string$folderUpload folder name, relative to PATH_site
Returns
string Input string prefixed with PATH_site

Definition at line 7152 of file DataHandler.php.

Referenced by DataHandler\extFileFunctions().

disableDeleteClause ( )

Disables the delete clause for fetching records. In general only undeleted records will be used. If the delete clause is disabled, also deleted records are taken into account.

Returns
void

Definition at line 7164 of file DataHandler.php.

Referenced by DataHandler\deleteClause().

doesBranchExist (   $inList,
  $pid,
  $perms,
  $recurse 
)

Checks if a whole branch of pages exists

Tests the branch under $pid (like doesRecordExist). It doesn't test the page with $pid as uid. Use doesRecordExist() for this purpose Returns an ID-list or "" if OK. Else -1 which means that somewhere there was no permission (eg. to delete). if $recurse is set, then the function will follow subpages. This MUST be set, if we need the idlist for deleting pages or else we get an incomplete list

Parameters
string$inListList of page uids, this is added to and outputted in the end
int$pidPage ID to select subpages from.
int$permsPerms integer to check each page record for.
bool$recurseRecursion flag: If set, it will go out through the branch.
Returns
string List of integers in branch

Definition at line 6285 of file DataHandler.php.

References DataHandler\deleteClause().

Referenced by DataHandler\canDeletePage(), and DataHandlerHook\versionizePages().

doesPageHaveUnallowedTables (   $page_uid,
  $doktype 
)

Checks if there are records on a page from tables that are not allowed

Parameters
int$page_uidPage ID
int$doktypePage doktype
Returns
array Returns a list of the tables that are 'present' on the page but not allowed with the page_uid/doktype

Definition at line 6399 of file DataHandler.php.

References GeneralUtility\trimExplode().

Referenced by DataHandler\checkValue().

doesRecordExist (   $table,
  $id,
  $perms 
)

Checks if record can be selected based on given permission criteria

Parameters
string$tableRecord table name
int$idRecord UID
int | string$permsPermission restrictions to observe: Either an integer that will be bitwise AND'ed or a string, which points to a key in the ->pMap array
Returns
bool Returns TRUE if the record given by $table, $id and $perms can be selected
Exceptions
\RuntimeException

Definition at line 6198 of file DataHandler.php.

References MathUtility\canBeInterpretedAsInteger(), DataHandler\deleteClause(), DataHandler\doesRecordExist_pageLookUp(), BackendUtility\fixVersioningPid(), BackendUtility\getRecordRaw(), DataHandler\isRecordInWebMount(), BackendUtility\isRootLevelRestrictionIgnored(), and BackendUtility\isWebMountRestrictionIgnored().

Referenced by DataHandler\canDeletePage(), DataHandler\cannotDeleteRecord(), DataHandler\checkRecordInsertAccess(), DataHandler\checkRecordUpdateAccess(), DataHandler\copyRecord_raw(), DataHandler\deleteRecord(), DataHandler\moveRecord(), and DataHandler\versionizeRecord().

doesRecordExist_pageLookUp (   $id,
  $perms 
)

Looks up a page based on permissions.

Parameters
int$idPage id
int$permsPermission integer
Returns
bool||object MySQLi result object / DBAL object (from exec_SELECTquery()) private
See Also
doesRecordExist()

Definition at line 6267 of file DataHandler.php.

References Permission\CONTENT_EDIT, DataHandler\deleteClause(), Permission\PAGE_DELETE, and Permission\PAGE_EDIT.

Referenced by DataHandler\doesRecordExist().

eventPid (   $table,
  $uid,
  $pid 
)
Parameters
string$table
int$uid
int$pid
Returns
int

Definition at line 6519 of file DataHandler.php.

Referenced by DataHandler\getRecordPropertiesFromRow(), and DataHandler\newlog2().

extFileFields (   $table)

Returns all fieldnames from a table which are a list of files

Parameters
string$tableTable name
Returns
array Array of fieldnames that are either "group" or "file" types.

Definition at line 7367 of file DataHandler.php.

Referenced by DataHandler\deleteRecord().

extFileFunctions (   $table,
  $field,
  $filelist,
  $func 
)

File functions on external file references. eg. deleting files when deleting record

Parameters
string$tableTable name
string$fieldField name
string$filelistList of files to work on from field
string$funcFunction, eg. "deleteAll" which will delete all files listed.
Returns
void

Definition at line 7539 of file DataHandler.php.

References DataHandler\destPathFromUploadFolder(), elseif, DataHandler\getResourceFactory(), and DataHandler\log().

Referenced by DataHandler\deleteRecord().

fillInFieldArray (   $table,
  $id,
  $fieldArray,
  $incomingFieldArray,
  $realPid,
  $status,
  $tscPID 
)

Filling in the field array $this->excludedTablesAndFields is used to filter fields if needed.

Parameters
string$tableTable name
int$idRecord ID
array$fieldArrayDefault values, Preset $fieldArray with 'pid' maybe (pid and uid will be not be overridden anyway)
array$incomingFieldArrayIs which fields/values you want to set. There are processed and put into $fieldArray if OK
int$realPidThe real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted.
string$statusIs 'new' or 'update'
int$tscPIDTSconfig PID
Returns
array Field Array

Definition at line 1420 of file DataHandler.php.

References DataHandler\checkValue(), GeneralUtility\deprecationLog(), elseif, BackendUtility\fixVersioningPid(), BackendUtility\getPagesTSconfig(), BackendUtility\getTCAtypes(), BackendUtility\getTCAtypeValue(), ArrayUtility\mergeRecursiveWithOverrule(), DataHandler\pageInfo(), DataHandler\recordInfo(), BackendUtility\RTEsetup(), GeneralUtility\stripSlashesOnArray(), DataHandler\transformRichtextContentToDatabase(), and BackendUtility\workspaceOL().

fixCopyAfterDuplFields (   $table,
  $uid,
  $prevUid,
  $update,
  $newData = array() 
)

When er record is copied you can specify fields from the previous record which should be copied into the new one This function is also called with new elements. But then $update must be set to zero and $newData containing the data array. In that case data in the incoming array is NOT overridden. (250202)

Parameters
string$tableTable name
int$uidRecord UID
int$prevUidUID of previous record
bool$updateIf set, updates the record
array$newDataInput array. If fields are already specified AND $update is not set, values are not set in output array.
Returns
array Output array (For when the copying operation needs to get the information instead of updating the info)

Definition at line 7344 of file DataHandler.php.

References DataHandler\recordInfo(), GeneralUtility\trimExplode(), and DataHandler\updateDB().

Referenced by DataHandler\moveRecord_raw().

fixUniqueInPid (   $table,
  $uid 
)

Checks if any uniqueInPid eval input fields are in the record and if so, they are re-written to be correct.

Parameters
string$tableTable name
int$uidRecord UID
Returns
void

Definition at line 7308 of file DataHandler.php.

References DataHandler\getUnique(), DataHandler\recordInfo(), GeneralUtility\trimExplode(), and DataHandler\updateDB().

Referenced by DataHandler\moveRecord_raw().

getAutoVersionId (   $table,
  $id 
)

Gets the automatically versionized id of a record.

Parameters
string$tableName of the table
int$idUid of the record
Returns
int

Definition at line 7980 of file DataHandler.php.

Referenced by DataHandler\overlayAutoVersionId().

getCacheManager ( )
protected

Create and returns an instance of the CacheManager

Returns
CacheManager

Definition at line 8250 of file DataHandler.php.

References GeneralUtility\makeInstance().

Referenced by DataHandler\clear_cacheCmd(), and DataHandler\getRuntimeCache().

getCheckModifyAccessListHookObjects ( )
protected

Gets the 'checkModifyAccessList' hook objects. The first call initializes the accordant objects.

Returns
array The 'checkModifyAccessList' hook objects (if any)
Exceptions
\UnexpectedValueException

Definition at line 917 of file DataHandler.php.

References DataHandler\$checkModifyAccessListHookObjects, $GLOBALS, and GeneralUtility\getUserObj().

getCommandMapElements (   $needle)
protected

Gets elements of the command map that match a particular command.

Parameters
string$needleThe command to be matched
Returns
array

Definition at line 8167 of file DataHandler.php.

Referenced by DataHandler\registerElementsToBeDeleted(), and DataHandler\unsetElementsToBeDeleted().

getCopyHeader (   $table,
  $pid,
  $field,
  $value,
  $count,
  $prevTitle = '' 
)

Get modified header for a copied record

Parameters
string$tableTable name
int$pidPID value in which other records to test might be
string$fieldField name to get header value for.
string$valueCurrent field value
int$countCounter (number of recursions)
string$prevTitlePrevious title we checked for (in previous recursion)
Returns
string The field value, possibly appended with a "copy label

Definition at line 7455 of file DataHandler.php.

References DataHandler\deleteClause(), and DataHandler\prependLabel().

getExcludeListArray ( )

Generate an array of fields to be excluded from editing for the user. Based on "exclude"-field in TCA and a look up in non_exclude_fields Will also generate this list for admin-users so they must be check for before calling the function

Returns
array Array of [table]-[field] pairs to exclude from editing.

Definition at line 6376 of file DataHandler.php.

References $list, and GeneralUtility\trimExplode().

Referenced by DataHandler\start().

getFieldEvalCacheIdentifier (   $additionalIdentifier)
protected

Return the cache entry identifier for field evals

Parameters
string$additionalIdentifier
Returns
string

Definition at line 8230 of file DataHandler.php.

Referenced by DataHandler\checkValueForInput(), and DataHandler\checkValueForText().

getInlineFieldType (   $conf)

Returns the subtype as a string of an inline field. If it's not an inline field at all, it returns FALSE.

Parameters
array$confConfig array for TCA/columns field
Returns
string|bool string Inline subtype (field|mm|list), boolean: FALSE

Definition at line 7427 of file DataHandler.php.

References elseif.

Referenced by DataHandler\copyRecord_flexFormCallBack(), DataHandler\copyRecord_procBasedOnFieldType(), DataHandler\moveRecord_procBasedOnFieldType(), DataHandlerHook\moveRecord_processFieldValue(), and DataHandlerHook\version_swap_processFields().

getLocalTCE (   $stripslashesValues = false,
  $dontProcessTransformations = true 
)
protected

Returns an instance of DataHandler for handling local datamaps/cmdmaps

Parameters
bool$stripslashesValuesIf TRUE, incoming values in the data-array have their slashes stripped.
bool$dontProcessTransformationsIf set, then transformations are NOT performed on the input.
Returns
DataHandler

Definition at line 5542 of file DataHandler.php.

References DataHandler\$cachedTSconfig, DataHandler\$copyTree, DataHandler\$dontProcessTransformations, and GeneralUtility\makeInstance().

getOuterMostInstance ( )
protected

Gets the outer most instance of Since can create nested objects of itself, this method helps to determine the first (= outer most) one.

Returns
DataHandler

Definition at line 8027 of file DataHandler.php.

References DataHandler\$outerMostInstance.

Referenced by DataHandler\isOuterMostInstance().

getPID (   $table,
  $uid 
)

Returns the pid of a record from $table with $uid

Parameters
string$tableTable name
int$uidRecord uid
Returns
int|FALSE PID value (unless the record did not exist in which case FALSE is returned)

Definition at line 7222 of file DataHandler.php.

getPlaceholderTitleForTableLabel (   $table,
  $placeholderContent = null 
)

Create a placeholder title for the label field that does match the field requirements

Parameters
string$tableThe table name
string$placeholderContentPlaceholder content to be used
Returns
string placeholder value

Definition at line 1391 of file DataHandler.php.

References DataHandler\checkValue_input_Eval(), and GeneralUtility\trimExplode().

Referenced by DataHandlerHook\moveRecord_wsPlaceholders().

getPreviousLocalizedRecordUid (   $table,
  $uid,
  $pid,
  $language 
)
protected

Returning uid of previous localized record, if any, for tables with a "sortby" column Used when new localized records are created so that localized records are sorted in the same order as the default language records

Parameters
string$tableTable name
int$uidUid of default language record
int$pidPid of default language record
int$languageLanguage of localization
Returns
int uid of record after which the localized record should be inserted

Definition at line 6876 of file DataHandler.php.

References DataHandler\deleteClause(), BackendUtility\getRecord(), and BackendUtility\getRecordLocalization().

getRecordProperties (   $table,
  $id,
  $noWSOL = false 
)

Returns an array with record properties, like header and pid No check for deleted or access is done! For versionized records, pid is resolved to its live versions pid. Used for logging

Parameters
string$tableTable name
int$idUid of record
bool$noWSOLIf set, no workspace overlay is performed
Returns
array Properties of record

Definition at line 6481 of file DataHandler.php.

References DataHandler\getRecordPropertiesFromRow(), DataHandler\recordInfo(), and BackendUtility\workspaceOL().

Referenced by DataHandler\checkRecordInsertAccess(), DataHandler\checkValue(), DataHandler\deleteRecord(), DataHandler\getSortNumber(), DataHandler\insertDB(), DataHandler\isRecordInWebMount(), DataHandler\moveRecord(), DataHandler\moveRecord_raw(), and DataHandler\newlog2().

getRecordPropertiesFromRow (   $table,
  $row 
)

Returns an array with record properties, like header and pid, based on the row

Parameters
string$tableTable name
array$rowInput row
Returns
array|NULL Output array

Definition at line 6497 of file DataHandler.php.

References DataHandler\eventPid(), BackendUtility\fixVersioningPid(), and BackendUtility\getRecordTitle().

Referenced by DataHandler\getRecordProperties(), DataHandler\insertDB(), and DataHandler\updateDB().

getRecordsWithSameValue (   $tableName,
  $uid,
  $fieldName,
  $value,
  $pageId = 0 
)

gets all records that have the same value in a field excluding the given uid

Parameters
string$tableNameTable name
int$uidUID to filter out in the lookup (the record itself...)
string$fieldNameField name for which $value must be unique
string$valueValue string.
int$pageIdIf set, the value will be unique for this PID
Returns
array

Definition at line 2735 of file DataHandler.php.

References BackendUtility\getRecordsByField().

Referenced by DataHandler\checkValueForCheck().

getResourceFactory ( )
protected

Gets the resourceFactory

Returns
ResourceFactory

Definition at line 8260 of file DataHandler.php.

References ResourceFactory\getInstance().

Referenced by DataHandler\extFileFunctions(), and DataHandler\removeRegisteredFiles().

getRuntimeCache ( )
protected

Gets an instance of the runtime cache.

Returns
VariableFrontend

Definition at line 8058 of file DataHandler.php.

References DataHandler\getCacheManager().

Referenced by DataHandler\__construct().

getSortNumber (   $table,
  $uid,
  $pid 
)

Returning sorting number for tables with a "sortby" column Using when new records are created and existing records are moved around.

Parameters
string$tableTable name
int$uidUid of record to find sorting number for. May be zero in case of new.
int$pidPositioning PID, either >=0 (pointing to page in which case we find sorting number for first record in page) or <0 (pointing to record in which case to find next sorting number after this record)
Returns
int|array|bool|NULL Returns integer if PID is >=0, otherwise an array with PID and sorting number. Possibly FALSE in case of error.

Definition at line 6745 of file DataHandler.php.

References DataHandler\$sortIntervals, DataHandler\deleteClause(), BackendUtility\getLiveVersionOfRecord(), BackendUtility\getMovePlaceholder(), DataHandler\getRecordProperties(), DataHandler\log(), and DataHandler\resorting().

Referenced by DataHandler\moveRecord_raw().

getTableEntries (   $table,
  $TSconfig 
)

Extract entries from TSconfig for a specific table. This will merge specific and default configuration together.

Parameters
string$tableTable name
array$TSconfigTSconfig for page
Returns
array TSconfig merged
See Also
getTCEMAIN_TSconfig()

Definition at line 7207 of file DataHandler.php.

References ArrayUtility\mergeRecursiveWithOverrule().

getTCEMAIN_TSconfig (   $tscPID)

Return TSconfig for a page id

Parameters
int$tscPIDPage id (PID) from which to get configuration.
Returns
array TSconfig array, if any

Definition at line 7191 of file DataHandler.php.

References BackendUtility\getPagesTSconfig().

getUnique (   $table,
  $field,
  $value,
  $id,
  $newPid = 0 
)

Gets a unique value for $table/$id/$field based on $value

Parameters
string$tableTable name
string$fieldField name for which $value must be unique
string$valueValue string.
int$idUID to filter out in the lookup (the record itself...)
int$newPidIf set, the value will be unique for this PID
Returns
string Modified value (if not-unique). Will be the value appended with a number (until 100, then the function just breaks).

Definition at line 2691 of file DataHandler.php.

References DataHandler\deleteClause().

Referenced by DataHandler\checkValueForInput(), and DataHandler\fixUniqueInPid().

getVersionizedIncomingFieldArray (   $table,
  $id,
$incomingFieldArray,
$registerDBList 
)

If a parent record was versionized on a workspace in $this->process_datamap, it might be possible, that child records (e.g. on using IRRE) were affected. This function finds these relations and updates their uids in the $incomingFieldArray. The $incomingFieldArray is updated by reference!

Parameters
string$tableTable name of the parent record
int$idUid of the parent record
array$incomingFieldArrayReference to the incomingFieldArray of process_datamap
array$registerDBListReference to the $registerDBList array that was created/updated by versionizing calls to TCEmain in process_datamap.
Returns
void

Definition at line 5991 of file DataHandler.php.

References DataHandler\$registerDBList.

hook_processDatamap_afterDatabaseOperations ( $hookObjectsArr,
$status,
$table,
$id,
$fieldArray 
)

Hook: processDatamap_afterDatabaseOperations (calls $hookObj->processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, $this);)

Note: When using the hook after INSERT operations, you will only get the temporary NEW... id passed to your hook as $id, but you can easily translate it to the real uid of the inserted record using the $this->substNEWwithIDs array.

Parameters
array$hookObjectsArr(reference) Array with hook objects
string$status(reference) Status of the current operation, 'new' or 'update
string$table(reference) The table currently processing data for
string$id(reference) The record uid currently processing data for, [integer] or [string] (like 'NEW...')
array$fieldArray(reference) The field array of a record
Returns
void

Definition at line 892 of file DataHandler.php.

insertDB (   $table,
  $id,
  $fieldArray,
  $newVersion = false,
  $suggestedUid = 0,
  $dontSetNewIdIndex = false 
)

Insert into database Does not check permissions but expects them to be verified on beforehand

Parameters
string$tableRecord table name
string$id"NEW...." uid string
array$fieldArrayArray of field=>value pairs to insert. FIELDS MUST MATCH the database FIELDS. No check is done. "pid" must point to the destination of the record!
bool$newVersionSet to TRUE if new version is created.
int$suggestedUidSuggested UID value for the inserted record. See the array $this->suggestedInsertUids; Admin-only feature
bool$dontSetNewIdIndexIf TRUE, the ->substNEWwithIDs array is not updated. Only useful in very rare circumstances!
Returns
int|NULL Returns ID on success.

Definition at line 6587 of file DataHandler.php.

References DataHandler\checkStoredRecord(), elseif, DataHandler\getRecordProperties(), DataHandler\getRecordPropertiesFromRow(), DataHandler\insertUpdateDB_preprocessBasedOnFieldType(), DataHandler\log(), and DataHandler\registerRecordIdForPageCacheClearing().

Referenced by DataHandler\insertNewCopyVersion(), and DataHandlerHook\moveRecord_wsPlaceholders().

insertNewCopyVersion (   $table,
  $fieldArray,
  $realPid 
)

Inserts a record in the database, passing TCA configuration values through checkValue() but otherwise does NOTHING and checks nothing regarding permissions. Passes the "version" parameter to insertDB() so the copy will look like a new version in the log - should probably be changed or modified a bit for more broad usage...

Parameters
string$tableTable name
array$fieldArrayField array to insert as a record
int$realPidThe value of PID field. -1 is indication that we are creating a new version!
Returns
int Returns the new ID of the record (if applicable)

Definition at line 3709 of file DataHandler.php.

References DataHandler\$dontProcessTransformations, DataHandler\$userid, DataHandler\checkValue(), StringUtility\getUniqueId(), and DataHandler\insertDB().

Referenced by DataHandler\copyRecord_raw().

insertUpdateDB_preprocessBasedOnFieldType (   $table,
  $fieldArray 
)

Preprocesses field array based on field type. Some fields must be adjusted before going to database. This is done on the copy of the field array because original values are used in remap action later.

Parameters
string$tableTable name
array$fieldArrayField array to check
Returns
array Updated field array

Definition at line 7956 of file DataHandler.php.

References MathUtility\canBeInterpretedAsInteger(), and GeneralUtility\trimExplode().

Referenced by DataHandler\insertDB(), and DataHandler\updateDB().

int_pageTreeInfo (   $CPtable,
  $pid,
  $counter,
  $rootID 
)

Returns array, $CPtable, of pages under the $pid going down to $counter levels. Selecting ONLY pages which the user has read-access to!

Parameters
array$CPtableAccumulation of page uid=>pid pairs in branch of $pid
int$pidPage ID for which to find subpages
int$counterNumber of levels to go down.
int$rootIDID of root point for new copied branch: The idea seems to be that a copy is not made of the already new page!
Returns
array Return array.

Definition at line 7272 of file DataHandler.php.

References DataHandler\deleteClause().

Referenced by DataHandler\copyPages(), and DataHandlerHook\versionizePages().

isElementToBeDeleted (   $table,
  $id 
)
protected

Determines whether an element was registered to be deleted in the registry.

Parameters
string$tableName of the table
int$idUid of the record
Returns
bool
See Also
registerElementsToBeDeleted
resetElementsToBeDeleted
copyRecord_raw
versionizeRecord

Definition at line 8114 of file DataHandler.php.

Referenced by DataHandler\copyRecord_raw(), and DataHandler\versionizeRecord().

isInWebMount (   $pid)

Checks if the input page ID is in the BE_USER webmounts

Parameters
int$pidPage ID to check
Returns
bool TRUE if OK. Cached results.

Definition at line 6059 of file DataHandler.php.

Referenced by DataHandler\isRecordInWebMount().

isNestedElementCallRegistered (   $table,
  $id,
  $identifier 
)
protected

Determines nested element calls.

Parameters
string$tableName of the table
int$idUid of the record
string$identifierName of the action to be checked
Returns
bool

Definition at line 8071 of file DataHandler.php.

isOuterMostInstance ( )

Determines whether the this object is the outer most instance of itself Since DataHandler can create nested objects of itself, this method helps to determine the first (= outer most) one.

Returns
bool

Definition at line 8048 of file DataHandler.php.

References DataHandler\getOuterMostInstance().

isRecordCopied (   $table,
  $uid 
)

Determine if a record was copied or if a record is the result of a copy action.

Parameters
string$tableThe tablename of the record
int$uidThe uid of the record
Returns
bool Returns TRUE if the record is copied or is the result of a copy action

Definition at line 7591 of file DataHandler.php.

References elseif.

Referenced by DataHandler\copyRecord_raw(), and DataHandlerHook\moveRecord().

isRecordInWebMount (   $table,
  $id 
)

Checking if a record with uid $id from $table is in the BE_USERS webmounts which is required for editing etc.

Parameters
string$tableTable name
int$idUID of record
Returns
bool Returns TRUE if OK. Cached results.

Definition at line 6044 of file DataHandler.php.

References DataHandler\getRecordProperties(), and DataHandler\isInWebMount().

Referenced by DataHandler\doesRecordExist().

isRecordUndeletable (   $table,
  $uid 
)

Determines whether a record can be undeleted.

Parameters
string$tableTable name of the record
int$uiduid of the record
Returns
bool Whether the record can be undeleted

Definition at line 5179 of file DataHandler.php.

References elseif, BackendUtility\getRecord(), and DataHandler\log().

Referenced by DataHandler\undeleteRecord().

isReferenceField (   $conf)

Returns TRUE if the TCA/columns field type is a DB reference field

Parameters
array$confConfig array for TCA/columns field
Returns
bool TRUE if DB reference field (group/db or select with foreign-table)

Definition at line 7415 of file DataHandler.php.

Referenced by DataHandler\copyRecord_flexFormCallBack(), DataHandler\copyRecord_procBasedOnFieldType(), and DataHandler\remapListedDBRecords_flexFormCallBack().

isSubmittedValueEqualToStoredValue (   $submittedValue,
  $storedValue,
  $storedType,
  $allowNull = false 
)
protected

Determines whether submitted values and stored values are equal. This prevents from adding superfluous field changes which would be shown in the record history as well. For NULL fields (see accordant TCA definition 'eval' = 'null'), a special handling is required since (!strcmp(NULL, '')) would be a false-positive.

Parameters
mixed$submittedValueValue that has submitted (e.g. from a backend form)
mixed$storedValueValue that is currently stored in the database
string$storedTypeSQL type of the stored value column (see mysql_field_type(), e.g 'int', 'string', ...)
bool$allowNullWhether NULL values are allowed by accordant TCA definition ('eval' = 'null')
Returns
bool Whether both values are considered to be equal

Definition at line 7072 of file DataHandler.php.

References elseif.

Referenced by DataHandler\compareFieldArrayWithCurrentAndUnset().

isTableAllowedForThisPage (   $page_uid,
  $checkTable 
)

Checks if a table is allowed on a certain page id according to allowed tables set for the page "doktype" and its [ctrl][rootLevel]-settings if any.

Parameters
int$page_uidPage id for which to check, including 0 (zero) if checking for page tree root.
string$checkTableTable name to check
Returns
bool TRUE if OK

Definition at line 6159 of file DataHandler.php.

References BackendUtility\isRootLevelRestrictionIgnored(), DataHandler\pageInfo(), and GeneralUtility\trimExplode().

Referenced by DataHandler\checkRecordInsertAccess().

log (   $table,
  $recuid,
  $action,
  $recpid,
  $error,
  $details,
  $details_nr = -1,
  $data = array(),
  $event_pid = -1,
  $NEWid = '' 
)

Logging actions from TCEmain

Parameters
string$tableTable name the log entry is concerned with. Blank if NA
int$recuidRecord UID. Zero if NA
int$actionAction number: 0=No category, 1=new record, 2=update record, 3= delete record, 4= move record, 5= Check/evaluate
int$recpidNormally 0 (zero). If set, it indicates that this log-entry is used to notify the backend of a record which is moved to another location
int$errorThe severity: 0 = message, 1 = error, 2 = System Error, 3 = security notice (admin)
string$detailsDefault error message in english
int$details_nrThis number is unique for every combination of $type and $action. This is the error-message number, which can later be used to translate error messages. 0 if not categorized, -1 if temporary
array$dataArray with special information that may go into $details by 's' marks / sprintf() when the log is shown
int$event_pidThe page_uid (pid) where the event occurred. Used to select log-content for specific pages.
string$NEWidNEW id for new records
Returns
int Log entry UID (0 if no log entry was written or logging is disabled)

Definition at line 7862 of file DataHandler.php.

Referenced by DataHandler\checkRecordInsertAccess(), DataHandler\checkStoredRecord(), DataHandler\checkValue(), DataHandler\checkValueForCheck(), DataHandler\copyPages(), DataHandler\copyRecord_raw(), DataHandler\deleteRecord(), DataHandler\extFileFunctions(), DataHandler\getSortNumber(), DataHandler\insertDB(), DataHandler\isRecordUndeletable(), DataHandler\moveRecord(), DataHandler\moveRecord_raw(), DataHandler\newlog(), DataHandler\newlog2(), DataHandler\updateDB(), and DataHandlerHook\version_setStage().

moveL10nOverlayRecords (   $table,
  $uid,
  $destPid,
  $originalRecordDestinationPid 
)

Find l10n-overlay records and perform the requested move action for these records.

Parameters
string$tableRecord Table
string$uidRecord UID
string$destPidPosition to move to
string$originalRecordDestinationPidPosition to move the original record to
Returns
void

Definition at line 4452 of file DataHandler.php.

References BackendUtility\getRecordsByField(), BackendUtility\isTableLocalizable(), and DataHandler\moveRecord().

Referenced by DataHandler\moveRecord_raw(), and DataHandlerHook\moveRecord_wsPlaceholders().

moveRecord (   $table,
  $uid,
  $destPid 
)

Moving single records

Parameters
string$tableTable name to move
int$uidRecord uid to move
int$destPidPosition to move to: $destPid: >=0 then it points to a page-id on which to insert the record (as the first element). <0 then it points to a uid from its own table after which to insert it (works if
Returns
void

Definition at line 4158 of file DataHandler.php.

References DataHandler\checkRecordInsertAccess(), DataHandler\checkRecordUpdateAccess(), DataHandler\doesRecordExist(), BackendUtility\getLiveVersionOfRecord(), DataHandler\getRecordProperties(), GeneralUtility\getUserObj(), DataHandler\log(), DataHandler\moveRecord_raw(), and DataHandler\resolvePid().

Referenced by DataHandler\moveL10nOverlayRecords(), DataHandler\moveRecord_procBasedOnFieldType(), and DataHandlerHook\moveRecord_processFieldValue().

moveRecord_procBasedOnFieldType (   $table,
  $uid,
  $destPid,
  $field,
  $value,
  $conf 
)

Move child records depending on the field type of the parent record.

Parameters
string$tableRecord Table
string$uidRecord UID
string$destPidPosition to move to
string$fieldRecord field
string$valueRecord field value
array$confTCA configuration of current field
Returns
void

Definition at line 4415 of file DataHandler.php.

References DataHandler\createRelationHandlerInstance(), DataHandler\getInlineFieldType(), and DataHandler\moveRecord().

Referenced by DataHandler\moveRecord_procFields().

moveRecord_procFields (   $table,
  $uid,
  $destPid 
)

Walk through all fields of the moved record and look for children of e.g. the inline type. If child records are found, they are also move to the new $destPid.

Parameters
string$tableRecord Table
string$uidRecord UID
string$destPidPosition to move to
Returns
void

Definition at line 4393 of file DataHandler.php.

References BackendUtility\getRecordWSOL(), and DataHandler\moveRecord_procBasedOnFieldType().

Referenced by DataHandler\moveRecord_raw().

moveRecord_raw (   $table,
  $uid,
  $destPid 
)

Moves a record without checking security of any sort. USE ONLY INTERNALLY

Parameters
string$tableTable name to move
int$uidRecord uid to move
int$destPidPosition to move to: $destPid: >=0 then it points to a page-id on which to insert the record (as the first element). <0 then it points to a uid from its own table after which to insert it (works if
Returns
void
See Also
moveRecord()

Definition at line 4245 of file DataHandler.php.

References DataHandler\destNotInsideSelf(), elseif, DataHandler\fixCopyAfterDuplFields(), DataHandler\fixUniqueInPid(), DataHandler\getRecordProperties(), DataHandler\getSortNumber(), GeneralUtility\getUserObj(), DataHandler\log(), DataHandler\moveL10nOverlayRecords(), DataHandler\moveRecord_procFields(), DataHandler\registerRecordIdForPageCacheClearing(), and DataHandler\resolvePid().

Referenced by DataHandler\moveRecord(), and DataHandlerHook\moveRecord_wsPlaceholders().

newFieldArray (   $table)

Returns a fieldArray with default values. Values will be picked up from the TCA array looking at the config key "default" for each column. If values are set in ->defaultValues they will overrule though. Used for new records and during copy operations for defaults

Parameters
string$tableTable name for which to set default values.
Returns
array Array with default values.

Definition at line 6944 of file DataHandler.php.

References DataHandler\$userid, DataHandler\assemblePermissions(), and elseif.

newlog (   $message,
  $error = 0 
)

Simple logging function meant to be used when logging messages is not yet fixed.

Parameters
string$messageMessage string
int$errorError code, see log()
Returns
int Log entry UID
See Also
log()

Definition at line 7890 of file DataHandler.php.

References DataHandler\log().

Referenced by DataHandlerHook\moveRecord(), DataHandler\process_uploads(), DataHandlerHook\processCmdmap_deleteAction(), DataHandlerHook\version_clearWSID(), DataHandlerHook\version_setStage(), DataHandlerHook\versionizePages(), and DataHandler\versionizeRecord().

newlog2 (   $message,
  $table,
  $uid,
  $pid = null,
  $error = 0 
)

Simple logging function meant to bridge the gap between newlog() and log() with a little more info, in particular the record table/uid and event_pid so we can filter messages per page.

Parameters
string$messageMessage string
string$tableTable name
int$uidRecord uid
int$pidRecord PID (from page tree). Will be turned into an event_pid internally in function: Meaning that the PID for a page will be its own UID, not its page tree PID.
int$errorError code, see log()
Returns
int Log entry UID
See Also
log()

Definition at line 7906 of file DataHandler.php.

References GeneralUtility\deprecationLog(), DataHandler\eventPid(), DataHandler\getRecordProperties(), and DataHandler\log().

Referenced by DataHandler\placeholderShadowing(), and DataHandlerHook\version_setStage().

noRecordsFromUnallowedTables (   $inList)

Used by the deleteFunctions to check if there are records from disallowed tables under the pages to be deleted.

Parameters
string$inListList of page integers
Returns
bool Return TRUE, if permission granted

Definition at line 7570 of file DataHandler.php.

References BackendUtility\deleteClause(), DataHandler\rmComma(), and DataHandler\tableReadOnly().

Referenced by DataHandler\canDeletePage().

overlayAutoVersionId (   $table,
  $id 
)
protected

Overlays the automatically versionized id of a record.

Parameters
string$tableName of the table
int$idUid of the record
Returns
int

Definition at line 7996 of file DataHandler.php.

References DataHandler\getAutoVersionId().

overrideFieldArray (   $table,
  $data 
)

Returns the $data array from $table overridden in the fields defined in ->overrideValues.

Parameters
string$tableTable name
array$dataData array with fields from table. These will be overlaid with values in $this->overrideValues[$table]
Returns
array Data array, processed.

Definition at line 6998 of file DataHandler.php.

pageInfo (   $id,
  $field 
)

Returns the value of the $field from page $id NOTICE; the function caches the result for faster delivery next time. You can use this function repeatedly without performance loss since it doesn't look up the same record twice!

Parameters
int$idPage uid
string$fieldField name for which to return value
Returns
string Value of the field. Result is cached in $this->pageCache[$id][$field] and returned from there next time!

Definition at line 6439 of file DataHandler.php.

Referenced by DataHandler\fillInFieldArray(), and DataHandler\isTableAllowedForThisPage().

placeholderShadowing (   $table,
  $id 
)

Fix shadowing of data in case we are editing an offline version of a live "New" placeholder record:

Parameters
string$tableTable name
int$idRecord uid
Returns
void

Definition at line 1357 of file DataHandler.php.

References Enumeration\cast(), BackendUtility\getLiveVersionOfRecord(), BackendUtility\getRecord(), DataHandler\newlog2(), GeneralUtility\trimExplode(), and DataHandler\updateDB().

prependLabel (   $table)

Return "copy" label for a table. Although the name is "prepend" it actually APPENDs the label (after ...)

Parameters
string$tableTable name
Returns
string Label to append, containing "%s" for the number
See Also
getCopyHeader()

Definition at line 7481 of file DataHandler.php.

Referenced by DataHandler\clearPrefixFromValue(), and DataHandler\getCopyHeader().

process_uploads (   $postFiles)

Processing of uploaded files. It turns out that some versions of PHP arranges submitted data for files different if sent in an array. This function will unify this so the internal array $this->uploadedFileArray will always contain files arranged in the same structure.

Parameters
array$postFiles$_FILES array
Returns
void

Definition at line 824 of file DataHandler.php.

References DataHandler\newlog(), and DataHandler\process_uploads_traverseArray().

process_uploads_traverseArray ( $outputArr,
  $inputArr,
  $keyToSet 
)

Traverse the upload array if needed to rearrange values.

Parameters
array$outputArr$this->uploadedFileArray passed by reference
array$inputArrInput array ($_FILES parts)
string$keyToSetThe current $_FILES array key to set on the outermost level.
Returns
void private
See Also
process_uploads()

Definition at line 862 of file DataHandler.php.

Referenced by DataHandler\process_uploads().

processRemapStack ( )

Processes the $this->remapStack at the end of copying, inserting, etc. actions. The remapStack takes care about the correct mapping of new and old uids in case of relational data.

Returns
void

Definition at line 5766 of file DataHandler.php.

References DataHandler\castReferenceValue(), DataHandler\checkValue_checkMax(), elseif, DataHandler\updateDB(), and DataHandler\updateFlexFormData().

Referenced by DataHandler\copySpecificPage().

recordInfo (   $table,
  $id,
  $fieldList 
)

Returns the row of a record given by $table and $id and $fieldList (list of fields, may be '*') NOTICE: No check for deleted or access!

Parameters
string$tableTable name
int$idUID of the record from $table
string$fieldListField list for the SELECT query, eg. "*" or "uid,pid,...
Returns
NULL|array Returns the selected record on success, otherwise NULL.

Definition at line 6460 of file DataHandler.php.

Referenced by DataHandler\checkValue(), DataHandler\copyRecord_raw(), DataHandler\fillInFieldArray(), DataHandler\fixCopyAfterDuplFields(), DataHandler\fixUniqueInPid(), DataHandler\getRecordProperties(), DataHandler\remapListedDBRecords(), DataHandler\updateFlexFormData(), and DataHandler\versionizeRecord().

registerElementsToBeDeleted ( )
protected

Registers elements to be deleted in the registry.

Returns
void
See Also
process_datamap

Definition at line 8126 of file DataHandler.php.

References DataHandler\getCommandMapElements().

registerNestedElementCall (   $table,
  $id,
  $identifier 
)
protected

Registers nested elements calls. This is used to track nested calls (e.g. for following m:n relations).

Parameters
string$tableName of the table
int$idUid of the record
string$identifierName of the action to be tracked
Returns
void

Definition at line 8086 of file DataHandler.php.

registerRecordIdForPageCacheClearing (   $table,
  $uid 
)

Clearing the cache based on a page being updated If the $table is 'pages' then cache is cleared for all pages on the same level (and subsequent?) Else just clear the cache for the parent page of the record.

Parameters
string$tableTable name of record that was just updated.
int$uidUID of updated / inserted record
Returns
void

Definition at line 7618 of file DataHandler.php.

Referenced by DataHandler\deleteRecord(), DataHandler\insertDB(), DataHandler\moveRecord_raw(), and DataHandler\updateDB().

remapListedDBRecords ( )

Processes the fields with references as registered during the copy process. This includes all FlexForm fields which had references.

Returns
void

Definition at line 5559 of file DataHandler.php.

References DataHandler\checkValue_flex_procInData(), debug(), BackendUtility\getFlexFormDS(), DataHandler\recordInfo(), DataHandler\remapListedDBRecords_procDBRefs(), DataHandler\updateDB(), BackendUtility\workspaceOL(), BackendUtility\wsMapId(), and GeneralUtility\xml2array().

remapListedDBRecords_flexFormCallBack (   $pParams,
  $dsConf,
  $dataValue,
  $dataValue_ext1,
  $dataValue_ext2 
)

Callback function for traversing the FlexForm structure in relation to creating copied files of file relations inside of flex form structures.

Parameters
array$pParamsSet of parameters in numeric array: table, uid, field
array$dsConfTCA config for field (from Data Structure of course)
string$dataValueField value (from FlexForm XML)
string$dataValue_ext1Not used
string$dataValue_ext2Not used
Returns
array Array where the "value" key carries the value.
See Also
checkValue_flex_procInData_travDS(), remapListedDBRecords()

Definition at line 5623 of file DataHandler.php.

References DataHandler\isReferenceField(), and DataHandler\remapListedDBRecords_procDBRefs().

remapListedDBRecords_procDBRefs (   $conf,
  $value,
  $MM_localUid,
  $table 
)

Performs remapping of old UID values to NEW uid values for a DB reference field.

Parameters
array$confTCA field config
string$valueField value
int$MM_localUidUID of local record (for MM relations - might need to change if support for FlexForms should be done!)
string$tableTable name
Returns
array|NULL Returns array of items ready to implode for field content.
See Also
remapListedDBRecords()

Definition at line 5648 of file DataHandler.php.

References DataHandler\createRelationHandlerInstance(), BackendUtility\getLiveVersionIdOfRecord(), and GeneralUtility\trimExplode().

Referenced by DataHandler\remapListedDBRecords(), and DataHandler\remapListedDBRecords_flexFormCallBack().

removeRegisteredFiles ( )

Removing files registered for removal before exit

Returns
void

Definition at line 7252 of file DataHandler.php.

References DataHandler\getResourceFactory().

resetElementsToBeDeleted ( )
protected

Resets the elements to be deleted in the registry.

Returns
void
See Also
process_datamap

Definition at line 8138 of file DataHandler.php.

resetNestedElementCalls ( )
protected

Resets the nested element calls.

Returns
void

Definition at line 8098 of file DataHandler.php.

resolvePid (   $table,
  $pid 
)

Get the final pid based on $table and $pid ($destPid type... pos/neg)

Parameters
string$tableTable name
int$pid"Destination pid" : If the value is >= 0 it's just returned directly (through (int)though) but if the value is <0 then the method looks up the record with the uid equal to abs($pid) (positive number) and returns the PID of that record! The idea is that negative numbers point to the record AFTER WHICH the position is supposed to be!
Returns
int

Definition at line 7498 of file DataHandler.php.

References BackendUtility\getLiveVersionOfRecord().

Referenced by DataHandler\moveRecord(), and DataHandler\moveRecord_raw().

resorting (   $table,
  $pid,
  $sortRow,
  $return_SortNumber_After_This_Uid 
)

Resorts a table. Used internally by getSortNumber()

Parameters
string$tableTable name
int$pidPid in which to resort records.
string$sortRowSorting row
int$return_SortNumber_After_This_UidUid of record from $table in this $pid and for which the return value will be set to a free sorting number after that record. This is used to return a sortingValue if the list is resorted because of inserting records inside the list and not in the top
Returns
int|NULL If $return_SortNumber_After_This_Uid is set, will contain usable sorting number after that record if found (otherwise 0) private
See Also
getSortNumber()

Definition at line 6839 of file DataHandler.php.

References DataHandler\$sortIntervals, and DataHandler\deleteClause().

Referenced by DataHandler\getSortNumber().

rmComma (   $input)

Returns the $input string without a comma in the end

Parameters
string$inputInput string
Returns
string Output string with any comma in the end removed, if any.

Definition at line 7119 of file DataHandler.php.

Referenced by DataHandler\noRecordsFromUnallowedTables().

setControl ( array  $control)
Parameters
array$control

Definition at line 706 of file DataHandler.php.

References DataHandler\$control.

setDefaultsFromUserTS (   $userTS)

Initializes default values coming from User TSconfig

Parameters
array$userTSUser TSconfig array
Returns
void

Definition at line 797 of file DataHandler.php.

References $GLOBALS.

setHistory (   $table,
  $id,
  $logId 
)

Setting sys_history record, based on content previously set in $this->historyRecords[$table . ':' . $id] (by compareFieldArrayWithCurrentAndUnset())

Parameters
string$tableTable name
int$idRecord ID
int$logIdLog entry ID, important for linking between log and history views
Returns
void

Definition at line 6699 of file DataHandler.php.

Referenced by DataHandler\updateDB().

setMirror (   $mirror)

Function that can mirror input values in datamap-array to other uid numbers. Example: $mirror[table][11] = '22,33' will look for content in $this->datamap[table][11] and copy it to $this->datamap[table][22] and $this->datamap[table][33]

Parameters
array$mirrorThis array has the syntax $mirror[table_name][uid] = [list of uids to copy data-value TO!]
Returns
void

Definition at line 767 of file DataHandler.php.

References GeneralUtility\trimExplode().

setNullValues ( array  $active,
array &  $haystack 
)
protected

Sets NULL values in haystack array. The general behaviour in the user interface is to enable/activate fields. Thus, this method uses NULL as value to be stored if a field is not active.

Parameters
array$activehierarchical array with active elements
array$haystackhierarchical array with haystack to be modified
Returns
void

Definition at line 8207 of file DataHandler.php.

References elseif.

Referenced by DataHandler\controlActiveElements().

setTSconfigPermissions (   $fieldArray,
  $TSConfig_p 
)

Setting up perms_* fields in $fieldArray based on TSconfig input Used for new pages

Parameters
array$fieldArrayField Array, returned with modifications
array$TSConfig_pTSconfig properties
Returns
array Modified Field Array

Definition at line 6917 of file DataHandler.php.

References DataHandler\assemblePermissions(), and MathUtility\canBeInterpretedAsInteger().

start (   $data,
  $cmd,
  $altUserObject = null 
)

Initializing. For details, see 'TYPO3 Core API' document. This function does not start the processing of data, but merely initializes the object

Parameters
array$dataData to be modified or inserted in the database
array$cmdCommands to copy, move, delete, localize, versionize records.
BackendUserAuthentication | NULL$altUserObjectAn alternative userobject you can set instead of the default, which is $GLOBALS['BE_USER']
Returns
void

Definition at line 721 of file DataHandler.php.

References DataHandler\$defaultPermissions, $GLOBALS, and DataHandler\getExcludeListArray().

tableAdminOnly (   $table)

Checks if the $table is only editable by admin-users

Parameters
string$tableTable name
Returns
bool TRUE, if readonly

Definition at line 6330 of file DataHandler.php.

tableReadOnly (   $table)

Checks if the $table is readOnly

Parameters
string$tableTable name
Returns
bool TRUE, if readonly

Definition at line 6318 of file DataHandler.php.

Referenced by DataHandler\noRecordsFromUnallowedTables().

transformRichtextContentToDatabase (   $value,
  $table,
  $field,
  $defaultExtras,
  $thisConfig,
  $pid 
)
protected

Performs transformation of content from richtext element to database.

Parameters
string$valueValue to transform.
string$tableThe table name
string$fieldThe field name
array$defaultExtrasDefault extras configuration of this field - typically "richtext:rte_transform[mode=ts_css]"
array$thisConfigConfiguration for RTEs; A mix between TSconfig and others. Configuration for additional transformation information
int$pidPID value of record (true parent page id)
Returns
string Transformed content

Definition at line 1588 of file DataHandler.php.

References BackendUtility\getSpecConfParametersFromArray(), and GeneralUtility\makeInstance().

Referenced by DataHandler\checkValue_flex_procInData_travDS(), and DataHandler\fillInFieldArray().

triggerRemapAction (   $table,
  $id,
array  $callback,
array  $arguments,
  $forceRemapStackActions = false 
)
protected

Triggers a remap action for a specific record.

Some records are post-processed by the processRemapStack() method (e.g. IRRE children). This method determines whether an action/modification is executed directly to a record or is postponed to happen after remapping data.

Parameters
string$tableName of the table
string$idId of the record (can also be a "NEW..." string)
array$callbackThe method to be called
array$argumentsThe arguments to be submitted to the callback method
bool$forceRemapStackActionsWhether to force to use the stack
Returns
void
See Also
processRemapStack

Definition at line 5936 of file DataHandler.php.

References DataHandler\addRemapAction().

undeleteRecord (   $table,
  $uid 
)

Undelete a single record

Parameters
string$tableTable name
int$uidRecord UID
Returns
void

Definition at line 4835 of file DataHandler.php.

References DataHandler\deleteRecord(), and DataHandler\isRecordUndeletable().

unsetElementsToBeDeleted ( array  $elements)
protected

Unsets elements (e.g. of the data map) that shall be deleted. This avoids to modify records that will be deleted later on.

Parameters
array$elementsElements to be modified
Returns
array

Definition at line 8150 of file DataHandler.php.

References ArrayUtility\arrayDiffAssocRecursive(), and DataHandler\getCommandMapElements().

updateDB (   $table,
  $id,
  $fieldArray 
)

Update database record Does not check permissions but expects them to be verified on beforehand

Parameters
string$tableRecord table name
int$idRecord uid
array$fieldArrayArray of field=>value pairs to insert. FIELDS MUST MATCH the database FIELDS. No check is done.
Returns
void

Definition at line 6538 of file DataHandler.php.

References DataHandler\checkStoredRecord(), elseif, DataHandler\getRecordPropertiesFromRow(), DataHandler\insertUpdateDB_preprocessBasedOnFieldType(), DataHandler\log(), DataHandler\registerRecordIdForPageCacheClearing(), and DataHandler\setHistory().

Referenced by DataHandler\fixCopyAfterDuplFields(), DataHandler\fixUniqueInPid(), DataHandler\placeholderShadowing(), DataHandler\processRemapStack(), DataHandler\remapListedDBRecords(), and DataHandler\updateFlexFormData().

updateFlexFormData (   $flexFormId,
array  $modifications 
)
protected

Updates FlexForm data.

Parameters
string$flexFormId,e.g.
<uid>:<field>
array$modificationsModifications with paths and values (e.g. 'sDEF/lDEV/field/vDEF' => 'TYPO3')
Returns
void

Definition at line 5885 of file DataHandler.php.

References MathUtility\canBeInterpretedAsInteger(), DataHandler\recordInfo(), ArrayUtility\setValueByPath(), DataHandler\updateDB(), BackendUtility\workspaceOL(), and GeneralUtility\xml2array().

Referenced by DataHandler\processRemapStack().

version_remapMMForVersionSwap_execSwap (   $table,
  $id,
  $swapWith 
)

Performing the remapping operations found necessary in version_remapMMForVersionSwap() It must be done in three steps with an intermediate "fake" uid. The UID can be something else than -$id (fx. 9999999+$id if you dare... :-)- as long as it is unique.

Parameters
string$tableTable for the two input records
int$idCurrent record (about to go offline)
int$swapWithSwap record (about to go online)
Returns
void
See Also
version_remapMMForVersionSwap()

Definition at line 5510 of file DataHandler.php.

versionizeRecord (   $table,
  $id,
  $label,
  $delete = false 
)

Creates a new version of a record (Requires support in the table)

Parameters
string$tableTable name
int$idRecord uid to versionize
string$labelVersion label
bool$deleteIf TRUE, the version is created to delete the record.
Returns
int|NULL Returns the id of the new version (if any)
See Also
copyRecord()

Definition at line 5319 of file DataHandler.php.

References DataHandler\cannotDeleteRecord(), Enumeration\cast(), DataHandler\copyRecord_raw(), VersionState\DEFAULT_STATE, VersionState\DELETE_PLACEHOLDER, DataHandler\deleteClause(), DataHandler\doesRecordExist(), BackendUtility\getWorkspaceVersionOfRecord(), DataHandler\isElementToBeDeleted(), VersionState\MOVE_PLACEHOLDER, DataHandler\newlog(), and DataHandler\recordInfo().

Referenced by DataHandlerHook\moveRecord(), DataHandlerHook\processCmdmap(), DataHandlerHook\processCmdmap_deleteAction(), and DataHandlerHook\versionizePages().

Member Data Documentation

$admin

Definition at line 375 of file DataHandler.php.

$alternativeFileName = array()

Definition at line 232 of file DataHandler.php.

$alternativeFilePath = array()

Definition at line 239 of file DataHandler.php.

$autoVersionIdMap = array()

Definition at line 277 of file DataHandler.php.

$autoVersioningUpdate = false

Definition at line 639 of file DataHandler.php.

$BE_USER

Definition at line 354 of file DataHandler.php.

$bypassAccessCheckForRecords = false

Definition at line 187 of file DataHandler.php.

$bypassFileHandling = false

Definition at line 179 of file DataHandler.php.

$bypassWorkspaceRestrictions = false

Definition at line 171 of file DataHandler.php.

$cachedTSconfig = array()

Definition at line 496 of file DataHandler.php.

Referenced by DataHandler\getLocalTCE().

$cachePrefixNestedElementCalls = 'core-datahandler-nestedElementCalls-'
protected

Definition at line 692 of file DataHandler.php.

$callBackObj

Definition at line 267 of file DataHandler.php.

$callFromImpExp = false

Definition at line 609 of file DataHandler.php.

$checkModifyAccessListHookObjects
protected

Definition at line 651 of file DataHandler.php.

Referenced by DataHandler\getCheckModifyAccessListHookObjects().

$checkSimilar = true

Definition at line 85 of file DataHandler.php.

$checkStoredRecords = true

Definition at line 102 of file DataHandler.php.

$checkStoredRecords_loose = true

Definition at line 109 of file DataHandler.php.

$checkValue_currentRecord = array()

Definition at line 632 of file DataHandler.php.

$checkWorkspaceCache = array()

Definition at line 510 of file DataHandler.php.

$clear_flexFormData_vDEFbase = false

Definition at line 146 of file DataHandler.php.

$cmdmap = array()

Definition at line 421 of file DataHandler.php.

$control = array()
protected

Definition at line 407 of file DataHandler.php.

Referenced by DataHandler\setControl().

$copiedFileMap = array()

Definition at line 312 of file DataHandler.php.

$copyMappingArray = array()

Definition at line 558 of file DataHandler.php.

$copyMappingArray_merged = array()

Definition at line 305 of file DataHandler.php.

$copyTree = 0

Definition at line 204 of file DataHandler.php.

Referenced by DataHandler\getLocalTCE().

$copyWhichTables = '*'

Definition at line 195 of file DataHandler.php.

$data_disableFields = array()

Definition at line 248 of file DataHandler.php.

$databaseConnection
protected

Definition at line 678 of file DataHandler.php.

$datamap = array()

Definition at line 414 of file DataHandler.php.

$dbAnalysisStore = array()

Definition at line 518 of file DataHandler.php.

$defaultPermissions
Initial value:
= array(
'user' => 'show,edit,delete,new,editcontent',
'group' => 'show,edit,new,editcontent',
'everybody' => ''
)

Definition at line 382 of file DataHandler.php.

Referenced by DataHandler\start().

$defaultValues = array()

Definition at line 214 of file DataHandler.php.

$deleteTree = false

Definition at line 117 of file DataHandler.php.

$disableDeleteClause = false
protected

Definition at line 646 of file DataHandler.php.

$dontProcessTransformations = false

Definition at line 138 of file DataHandler.php.

Referenced by DataHandler\getLocalTCE(), and DataHandler\insertNewCopyVersion().

$enableLogging = true

Definition at line 69 of file DataHandler.php.

$errorLog = array()

Definition at line 326 of file DataHandler.php.

$excludedTablesAndFields = array()
protected

Definition at line 393 of file DataHandler.php.

$fileFunc

Definition at line 625 of file DataHandler.php.

$historyRecords = array()
protected

Definition at line 435 of file DataHandler.php.

$include_filefunctions

Definition at line 399 of file DataHandler.php.

$isImporting = false

Definition at line 131 of file DataHandler.php.

$isInWebMount_Cache = array()

Definition at line 489 of file DataHandler.php.

$isRecordInWebMount_Cache = array()

Definition at line 482 of file DataHandler.php.

$mmHistoryRecords = array()
protected

Definition at line 428 of file DataHandler.php.

$neverHideAtCopy = false

Definition at line 124 of file DataHandler.php.

$newIndexMap = array()

Definition at line 616 of file DataHandler.php.

$newRelatedIDs = array()

Definition at line 298 of file DataHandler.php.

$outerMostInstance = null
protected

Definition at line 664 of file DataHandler.php.

Referenced by DataHandler\getOuterMostInstance().

$overrideValues = array()

Definition at line 223 of file DataHandler.php.

Referenced by DataHandler\copyL10nOverlayRecords().

$pageCache = array()

Definition at line 503 of file DataHandler.php.

$pagetreeNeedsRefresh = false

Definition at line 340 of file DataHandler.php.

$pagetreeRefreshFieldsFromPages = array('pid', 'sorting', 'deleted', 'hidden', 'title', 'doktype', 'is_siteroot', 'fe_group', 'nav_hide', 'nav_title', 'module', 'starttime', 'endtime', 'content_from_pid')

Definition at line 333 of file DataHandler.php.

$pMap
Initial value:
= array(
'show' => 1,
'edit' => 2,
'delete' => 4,
'new' => 8,
'editcontent' => 16
)

Definition at line 443 of file DataHandler.php.

$recInsertAccessCache = array()

Definition at line 475 of file DataHandler.php.

$recordsToClearCacheFor = array()
staticprotected

Definition at line 671 of file DataHandler.php.

$recUpdateAccessCache = array()

Definition at line 468 of file DataHandler.php.

$registerDBList = array()

Definition at line 539 of file DataHandler.php.

Referenced by DataHandler\getVersionizedIncomingFieldArray().

$registerDBPids = array()

Definition at line 546 of file DataHandler.php.

$remapStack = array()

Definition at line 565 of file DataHandler.php.

$remapStackActions = array()
protected

Definition at line 587 of file DataHandler.php.

$remapStackChildIds = array()
protected

Definition at line 580 of file DataHandler.php.

$remapStackRecords = array()

Definition at line 573 of file DataHandler.php.

$remapStackRefIndex = array()
protected

Definition at line 594 of file DataHandler.php.

$removeFilesStore = array()

Definition at line 525 of file DataHandler.php.

$reverseOrder = false

Definition at line 77 of file DataHandler.php.

$RTEmagic_copyIndex = array()

Definition at line 319 of file DataHandler.php.

$runtimeCache = null
protected

Definition at line 685 of file DataHandler.php.

$sortIntervals = 256

Definition at line 460 of file DataHandler.php.

Referenced by DataHandler\getSortNumber(), and DataHandler\resorting().

$storeLogMessages = true

Definition at line 62 of file DataHandler.php.

$stripslashes_values = true

Definition at line 94 of file DataHandler.php.

$substNEWwithIDs = array()

Definition at line 284 of file DataHandler.php.

$substNEWwithIDs_table = array()

Definition at line 291 of file DataHandler.php.

$suggestedInsertUids = array()

Definition at line 259 of file DataHandler.php.

$updateModeL10NdiffData = true

Definition at line 155 of file DataHandler.php.

$updateModeL10NdiffDataClear = false

Definition at line 163 of file DataHandler.php.

$updateRefIndexStack = array()

Definition at line 601 of file DataHandler.php.

$uploadedFileArray = array()

Definition at line 532 of file DataHandler.php.

$userid

Definition at line 361 of file DataHandler.php.

Referenced by DataHandler\insertNewCopyVersion(), and DataHandler\newFieldArray().

$username

Definition at line 368 of file DataHandler.php.

$version_remapMMForVersionSwap_reg
protected

Definition at line 656 of file DataHandler.php.