Documentation TYPO3 par Ameos |
Public Member Functions | |
updateRefIndexTable ($table, $uid, $testOnly=FALSE) | |
generateRefIndexData ($table, $uid) | |
createEntryData ($table, $uid, $field, $flexpointer, $deleted, $ref_table, $ref_uid, $ref_string='', $sort=-1, $softref_key='', $softref_id='') | |
createEntryData_dbRels ($table, $uid, $fieldname, $flexpointer, $deleted, $items) | |
createEntryData_fileRels ($table, $uid, $fieldname, $flexpointer, $deleted, $items) | |
createEntryData_softreferences ($table, $uid, $fieldname, $flexpointer, $deleted, $keys) | |
getRelations ($table, $row, $onlyField='') | |
getRelations_flexFormCallBack ($dsArr, $dataValue, $PA, $structurePath, &$pObj) | |
getRelations_procFiles ($value, $conf, $uid) | |
getRelations_procDB ($value, $conf, $uid, $table= '') | |
setReferenceValue ($hash, $newValue, $returnDataArray=FALSE) | |
setReferenceValue_dbRels ($refRec, $itemArray, $newValue, &$dataArray, $flexpointer='') | |
setReferenceValue_fileRels ($refRec, $itemArray, $newValue, &$dataArray, $flexpointer='') | |
setReferenceValue_softreferences ($refRec, $softref, $newValue, &$dataArray, $flexpointer='') | |
wordIndexing ($table, $uid) | |
updateWordIndex ($words, $table, $uid) | |
submitWords ($wl) | |
isReferenceField ($conf) | |
destPathFromUploadFolder ($folder) | |
error ($msg) | |
updateIndex ($testOnly, $cli_echo=FALSE) | |
Public Attributes | |
$temp_flexRelations = array() | |
$errorLog = array() | |
$WSOL = FALSE | |
$relations = array() | |
$words_strings = array() | |
$words = array() | |
$hashVersion = 1 |
Definition at line 83 of file class.t3lib_refindex.php.
t3lib_refindex::updateRefIndexTable | ( | $ | table, | |
$ | uid, | |||
$ | testOnly = FALSE | |||
) |
Call this function to update the sys_refindex table for a record (even one just deleted) NOTICE: Currently, references updated for a deleted-flagged record will not include those from within flexform fields in some cases where the data structure is defined by another record since the resolving process ignores deleted records! This will also result in bad cleaning up in tcemain I think... Anyway, thats the story of flexforms; as long as the DS can change, lots of references can get lost in no time.
string | Table name | |
integer | UID of record | |
boolean | If set, nothing will be written to the index but the result value will still report statistics on what is added, deleted and kept. Can be used for mere analysis. |
Definition at line 105 of file class.t3lib_refindex.php.
References $relations, generateRefIndexData(), t3lib_BEfunc::getRecordRaw(), and wordIndexing().
t3lib_refindex::generateRefIndexData | ( | $ | table, | |
$ | uid | |||
) |
Returns array of arrays with an index of all references found in record from table/uid If the result is used to update the sys_refindex table then ->WSOL must NOT be true (no workspace overlay anywhere!)
string | Table name from $TCA | |
integer | Record UID |
Definition at line 179 of file class.t3lib_refindex.php.
References createEntryData_dbRels(), createEntryData_fileRels(), createEntryData_softreferences(), getRelations(), t3lib_div::inList(), t3lib_div::loadTCA(), and t3lib_div::testInt().
Referenced by updateRefIndexTable().
t3lib_refindex::createEntryData | ( | $ | table, | |
$ | uid, | |||
$ | field, | |||
$ | flexpointer, | |||
$ | deleted, | |||
$ | ref_table, | |||
$ | ref_uid, | |||
$ | ref_string = '' , |
|||
$ | sort = -1 , |
|||
$ | softref_key = '' , |
|||
$ | softref_id = '' | |||
) |
Create array with field/value pairs ready to insert in database. The "hash" field is a fingerprint value across this table.
string | Tablename of source record (where reference is located) | |
integer | UID of source record (where reference is located) | |
string | Fieldname of source record (where reference is located) | |
string | Pointer to location inside flexform structure where reference is located in [field] | |
integer | Whether record is deleted-flagged or not | |
string | For database references; the tablename the reference points to. Special keyword "_FILE" indicates that "ref_string" is a file reference either absolute or relative to PATH_site. Special keyword "_STRING" indicates some special usage (typ. softreference) where "ref_string" is used for the value. | |
integer | For database references; The UID of the record (zero "ref_table" is "_FILE" or "_STRING") | |
string | For "_FILE" or "_STRING" references: The filepath (relative to PATH_site or absolute) or other string. | |
integer | The sorting order of references if many (the "group" or "select" TCA types). -1 if no sorting order is specified. | |
string | If the reference is a soft reference, this is the soft reference parser key. Otherwise empty. | |
string | Soft reference ID for key. Might be useful for replace operations. |
Definition at line 268 of file class.t3lib_refindex.php.
Referenced by createEntryData_dbRels(), createEntryData_fileRels(), and createEntryData_softreferences().
t3lib_refindex::createEntryData_dbRels | ( | $ | table, | |
$ | uid, | |||
$ | fieldname, | |||
$ | flexpointer, | |||
$ | deleted, | |||
$ | items | |||
) |
Enter database references to ->relations array
string | [See createEntryData, arg 1] | |
integer | [See createEntryData, arg 2] | |
string | [See createEntryData, arg 3] | |
string | [See createEntryData, arg 4] | |
string | [See createEntryData, arg 5] | |
array | Data array with databaes relations (table/id) |
Definition at line 295 of file class.t3lib_refindex.php.
References createEntryData().
Referenced by generateRefIndexData().
t3lib_refindex::createEntryData_fileRels | ( | $ | table, | |
$ | uid, | |||
$ | fieldname, | |||
$ | flexpointer, | |||
$ | deleted, | |||
$ | items | |||
) |
Enter file references to ->relations array
string | [See createEntryData, arg 1] | |
integer | [See createEntryData, arg 2] | |
string | [See createEntryData, arg 3] | |
string | [See createEntryData, arg 4] | |
string | [See createEntryData, arg 5] | |
array | Data array with file relations |
Definition at line 312 of file class.t3lib_refindex.php.
References createEntryData(), and t3lib_div::isFirstPartOfStr().
Referenced by generateRefIndexData().
t3lib_refindex::createEntryData_softreferences | ( | $ | table, | |
$ | uid, | |||
$ | fieldname, | |||
$ | flexpointer, | |||
$ | deleted, | |||
$ | keys | |||
) |
Enter softref references to ->relations array
string | [See createEntryData, arg 1] | |
integer | [See createEntryData, arg 2] | |
string | [See createEntryData, arg 3] | |
string | [See createEntryData, arg 4] | |
string | [See createEntryData, arg 5] | |
array | Data array with soft reference keys |
Definition at line 333 of file class.t3lib_refindex.php.
References createEntryData().
Referenced by generateRefIndexData().
t3lib_refindex::getRelations | ( | $ | table, | |
$ | row, | |||
$ | onlyField = '' | |||
) |
Returns relation information for a $table/$row-array Traverses all fields in input row which are configured in TCA/columns It looks for hard relations to files and records in the TCA types "select" and "group"
string | Table name | |
array | Row from table | |
string | Specific field to fetch for. |
Definition at line 389 of file class.t3lib_refindex.php.
References t3lib_BEfunc::explodeSoftRefParserList(), t3lib_BEfunc::getFlexFormDS(), getRelations_flexFormCallBack(), getRelations_procDB(), getRelations_procFiles(), t3lib_div::loadTCA(), t3lib_div::makeInstance(), t3lib_BEfunc::softRefParserObj(), and t3lib_div::xml2array().
Referenced by generateRefIndexData(), and setReferenceValue().
t3lib_refindex::getRelations_flexFormCallBack | ( | $ | dsArr, | |
$ | dataValue, | |||
$ | PA, | |||
$ | structurePath, | |||
&$ | pObj | |||
) |
Callback function for traversing the FlexForm structure in relation to finding file and DB references!
array | Data structure for the current value | |
mixed | Current value | |
array | Additional configuration used in calling function | |
string | Path of value in DS structure | |
object | Object reference to caller |
Definition at line 487 of file class.t3lib_refindex.php.
References t3lib_BEfunc::explodeSoftRefParserList(), getRelations_procDB(), getRelations_procFiles(), and t3lib_BEfunc::softRefParserObj().
Referenced by getRelations().
t3lib_refindex::getRelations_procFiles | ( | $ | value, | |
$ | conf, | |||
$ | uid | |||
) |
Check field configuration if it is a file relation field and extract file relations if any
string | Field value | |
array | Field configuration array of type "TCA/columns" | |
integer | Field uid |
Definition at line 537 of file class.t3lib_refindex.php.
References destPathFromUploadFolder(), and t3lib_div::makeInstance().
Referenced by getRelations(), and getRelations_flexFormCallBack().
t3lib_refindex::getRelations_procDB | ( | $ | value, | |
$ | conf, | |||
$ | uid, | |||
$ | table = '' | |||
) |
Check field configuration if it is a DB relation field and extract DB relations if any
string | Field value | |
array | Field configuration array of type "TCA/columns" | |
integer | Field uid | |
string | Table name |
Definition at line 588 of file class.t3lib_refindex.php.
References isReferenceField(), and t3lib_div::makeInstance().
Referenced by getRelations(), and getRelations_flexFormCallBack().
t3lib_refindex::setReferenceValue | ( | $ | hash, | |
$ | newValue, | |||
$ | returnDataArray = FALSE | |||
) |
Setting the value of a reference or removing it completely. Usage: For lowlevel clean up operations! WARNING: With this you can set values that are not allowed in the database since it will bypass all checks for validity! Hence it is targetted at clean-up operations. Please use TCEmain in the usual ways if you wish to manipulate references. Since this interface allows updates to soft reference values (which TCEmain does not directly) you may like to use it for that as an exception to the warning above. Notice; If you want to remove multiple references from the same field, you MUST start with the one having the highest sorting number. If you don't the removal of a reference with a lower number will recreate an index in which the remaining references in that field has new hash-keys due to new sorting numbers - and you will get errors for the remaining operations which cannot find the hash you feed it! To ensure proper working only admin-BE_USERS in live workspace should use this function
string | 32-byte hash string identifying the record from sys_refindex which you wish to change the value for | |
mixed | Value you wish to set for reference. If NULL, the reference is removed (unless a soft-reference in which case it can only be set to a blank string). If you wish to set a database reference, use the format "[table]:[uid]". Any other case, the input value is set as-is | |
boolean | Return $dataArray only, do not submit it to database. |
Definition at line 636 of file class.t3lib_refindex.php.
References getRelations(), t3lib_div::makeInstance(), setReferenceValue_dbRels(), setReferenceValue_fileRels(), and setReferenceValue_softreferences().
Referenced by tx_lowlevel_missing_relations::main_autoFix(), tx_lowlevel_missing_files::main_autoFix(), and tx_lowlevel_double_files::main_autoFix().
t3lib_refindex::setReferenceValue_dbRels | ( | $ | refRec, | |
$ | itemArray, | |||
$ | newValue, | |||
&$ | dataArray, | |||
$ | flexpointer = '' | |||
) |
Setting a value for a reference for a DB field:
array | sys_refindex record | |
array | Array of references from that field | |
string | Value to substitute current value with (or NULL to unset it) | |
array | data array in which the new value is set (passed by reference) | |
string | Flexform pointer, if in a flex form field. |
Definition at line 736 of file class.t3lib_refindex.php.
References t3lib_div::makeInstance().
Referenced by setReferenceValue().
t3lib_refindex::setReferenceValue_fileRels | ( | $ | refRec, | |
$ | itemArray, | |||
$ | newValue, | |||
&$ | dataArray, | |||
$ | flexpointer = '' | |||
) |
Setting a value for a reference for a FILE field:
array | sys_refindex record | |
array | Array of references from that field | |
string | Value to substitute current value with (or NULL to unset it) | |
array | data array in which the new value is set (passed by reference) | |
string | Flexform pointer, if in a flex form field. |
Definition at line 774 of file class.t3lib_refindex.php.
References t3lib_div::makeInstance().
Referenced by setReferenceValue().
t3lib_refindex::setReferenceValue_softreferences | ( | $ | refRec, | |
$ | softref, | |||
$ | newValue, | |||
&$ | dataArray, | |||
$ | flexpointer = '' | |||
) |
Setting a value for a soft reference token
array | sys_refindex record | |
array | Array of soft reference occurencies | |
string | Value to substitute current value with | |
array | data array in which the new value is set (passed by reference) | |
string | Flexform pointer, if in a flex form field. |
Definition at line 812 of file class.t3lib_refindex.php.
References error(), and t3lib_div::makeInstance().
Referenced by setReferenceValue().
t3lib_refindex::updateWordIndex | ( | $ | words, | |
$ | table, | |||
$ | uid | |||
) |
Update/Create word index for record
array | Word list array (words are values in array) | |
string | Table | |
integer | Rec uid |
Definition at line 876 of file class.t3lib_refindex.php.
References $words, t3lib_div::md5int(), and submitWords().
Referenced by wordIndexing().
t3lib_refindex::submitWords | ( | $ | wl | ) |
Adds new words to db
array | Word List array (where each word has information about position etc). |
Definition at line 911 of file class.t3lib_refindex.php.
References t3lib_div::md5int().
Referenced by updateWordIndex().
t3lib_refindex::isReferenceField | ( | $ | conf | ) |
Returns true if the TCA/columns field type is a DB reference field
array | config array for TCA/columns field |
Definition at line 960 of file class.t3lib_refindex.php.
Referenced by getRelations_procDB().
t3lib_refindex::destPathFromUploadFolder | ( | $ | folder | ) |
Returns destination path to an upload folder given by $folder
string | Folder relative to PATH_site |
Definition at line 970 of file class.t3lib_refindex.php.
Referenced by getRelations_procFiles().
t3lib_refindex::error | ( | $ | msg | ) |
Sets error message in the internal error log
string | Error message |
Definition at line 980 of file class.t3lib_refindex.php.
Referenced by setReferenceValue_softreferences().
t3lib_refindex::updateIndex | ( | $ | testOnly, | |
$ | cli_echo = FALSE | |||
) |
Updating Index (External API)
boolean | If set, only a test | |
boolean | If set, output CLI status |
Definition at line 991 of file class.t3lib_refindex.php.
References t3lib_div::makeInstance().