original_string: private function buildFacetsArray($facetsJson) {
          foreach($facetsJson as $facetObj) {
              //build array of term with <term> => <number of occurences>
              $terms = array();
              foreach($facetObj->terms as $termObj) {
                  $terms[$termObj->term] = $termObj->count;
              }
              $this->facets[$facetObj->fieldName] = $terms;
          }
      }
code: private function buildFacetsArray($facetsJson) {
          foreach($facetsJson as $facetObj) {
              //build array of term with <term> => <number of occurences>
              $terms = array();
              foreach($facetObj->terms as $termObj) {
                  $terms[$termObj->term] = $termObj->count;
              }
              $this->facets[$facetObj->fieldName] = $terms;
          }
      }
code_tokens: private function buildFacetsArray ( $ facetsJson ) { foreach ( $ facetsJson as $ facetObj ) { //build array of term with <term> => <number of occurences> $ terms = array ( ) ; foreach ( $ facetObj -> terms as $ termObj ) { $ terms [ $ termObj -> term ] = $ termObj -> count ; } $ this -> facets [ $ facetObj -> fieldName ] = $ terms ; } }
docstring: Build array of facets based on JSON results
  @param array $facetsJson Array of JSON values for facets
docstring_tokens: Build array of facets based on JSON results