You are here

function apachesolr_flatten_documents_array in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 apachesolr.module \apachesolr_flatten_documents_array()
  2. 6.2 apachesolr.module \apachesolr_flatten_documents_array()
  3. 7 apachesolr.module \apachesolr_flatten_documents_array()

Function to flatten documents array recursively.

Parameters

array $documents: The array of documents being indexed.

array &$tmp: A container variable that will contain the flattened array.

File

./apachesolr.module, line 831
Integration with the Apache Solr search application.

Code

function apachesolr_flatten_documents_array($documents, &$tmp) {
  foreach ($documents as $index => $item) {
    if (is_array($item)) {
      apachesolr_flatten_documents_array($item, $tmp);
    }
    elseif (is_object($item)) {
      $tmp[] = $item;
    }
  }
}