You are here

function hook_scanner_fields_alter in Search and Replace Scanner 7

Allow the list of supported fields to be extended.

This function will search recursively down any level of field collection nesting to find all text fields. Note that if a field collection is nested within itself, this function will not traverse the field collection a second time (which would otherwise result in infinite recusion).

Parameters

array $all_field_records: Array of field records curerntly being built.

string $node_bundle: The name of the node type being searched. Initially passed in as NULL b/c the first time this function runs it finds all "top level" field collections, which can be across multiple node types. For each field collection instance found, however, if there are field collections inside of it we call this function recursively to find more fields. On that recursive call, we pass in the node type where the top level field collection was found so that we have the appropriate node type to add to the text field records added to $all_field_records.

string $parent_bundle: The bundle in which we are currently searching for field collections. Initially passed in as NULL b/c the first time this function runs it finds all "top level" field collections, which can be across multiple node types (a.k.a. bundles). For each field collection instance found, however, if there are field collections inside of it we call this function recursively to find more fields. On that recursive call, we pass in the bundle of the current field collection being searched so that the query in the recursive call can search for fields within that bundle.

array $parents: An array tracking all field collection parents for text fields we eventually find. Initially passed in as NULL b/c the first time this function runs it finds all "top level" field collections, which must each have its own instance of the $parents array. The $parents array serves two purposes. First, it is used to set the "field_collection_parents" value for all text fields found. Second, it is used to prevent infinite recursion in the case where a field collection is nested within itself.

1 function implements hook_scanner_fields_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

field_collection_scanner_fields_alter in ./scanner.module
Implements hook_scanner_fields_alter().
1 invocation of hook_scanner_fields_alter()
_scanner_get_all_tables_map in ./scanner.module
Get all text fields.

File

./scanner.api.php, line 134
API documentation and examples for the Search and Replace Scanner module.

Code

function hook_scanner_fields_alter(array &$all_field_records, $node_bundle = NULL, $parent_bundle = NULL, $parents = NULL) {
}