You are here

function apachesolr_flatten_documents_array in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_flatten_documents_array()
  2. 6.3 apachesolr.module \apachesolr_flatten_documents_array()
  3. 6.2 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 825
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;
    }
  }
}