original_string: private function referenceSubfields($currentSubfieldSpec)
      {
          $baseSubfieldSpec = $this->baseSpec.$currentSubfieldSpec->getBaseSpec();
  
          if ($subfields = $this->cache->getData($this->currentSpec['field'], $currentSubfieldSpec)) {
              return $subfields;
          }
  
          $_subfields = $this->field->getSubfields($currentSubfieldSpec['tag']);
  
          if (!$_subfields) {
              $this->cache[$baseSubfieldSpec] = [];
  
              return [];
          }
  
          /* filter on indizes */
          if ($_indexRange = $this->getIndexRange($currentSubfieldSpec, count($_subfields))) {
              foreach ($_subfields as $sfkey => $item) {
                  if (!in_array($sfkey, $_indexRange) || $item->isEmpty()) {
                      unset($_subfields[$sfkey]);
                  }
              }
          }
  
          if ($_subfields) {
              $sf_values = array_values($_subfields);
              $this->cache[$baseSubfieldSpec] = $sf_values;
  
              return $sf_values;
          }
  
          $this->cache[$baseSubfieldSpec] = [];
  
          return [];
      }
code: private function referenceSubfields($currentSubfieldSpec)
      {
          $baseSubfieldSpec = $this->baseSpec.$currentSubfieldSpec->getBaseSpec();
  
          if ($subfields = $this->cache->getData($this->currentSpec['field'], $currentSubfieldSpec)) {
              return $subfields;
          }
  
          $_subfields = $this->field->getSubfields($currentSubfieldSpec['tag']);
  
          if (!$_subfields) {
              $this->cache[$baseSubfieldSpec] = [];
  
              return [];
          }
  
          /* filter on indizes */
          if ($_indexRange = $this->getIndexRange($currentSubfieldSpec, count($_subfields))) {
              foreach ($_subfields as $sfkey => $item) {
                  if (!in_array($sfkey, $_indexRange) || $item->isEmpty()) {
                      unset($_subfields[$sfkey]);
                  }
              }
          }
  
          if ($_subfields) {
              $sf_values = array_values($_subfields);
              $this->cache[$baseSubfieldSpec] = $sf_values;
  
              return $sf_values;
          }
  
          $this->cache[$baseSubfieldSpec] = [];
  
          return [];
      }
code_tokens: private function referenceSubfields ( $ currentSubfieldSpec ) { $ baseSubfieldSpec = $ this -> baseSpec . $ currentSubfieldSpec -> getBaseSpec ( ) ; if ( $ subfields = $ this -> cache -> getData ( $ this -> currentSpec [ 'field' ] , $ currentSubfieldSpec ) ) { return $ subfields ; } $ _subfields = $ this -> field -> getSubfields ( $ currentSubfieldSpec [ 'tag' ] ) ; if ( ! $ _subfields ) { $ this -> cache [ $ baseSubfieldSpec ] = [ ] ; return [ ] ; } /* filter on indizes */ if ( $ _indexRange = $ this -> getIndexRange ( $ currentSubfieldSpec , count ( $ _subfields ) ) ) { foreach ( $ _subfields as $ sfkey => $ item ) { if ( ! in_array ( $ sfkey , $ _indexRange ) || $ item -> isEmpty ( ) ) { unset ( $ _subfields [ $ sfkey ] ) ; } } } if ( $ _subfields ) { $ sf_values = array_values ( $ _subfields ) ; $ this -> cache [ $ baseSubfieldSpec ] = $ sf_values ; return $ sf_values ; } $ this -> cache [ $ baseSubfieldSpec ] = [ ] ; return [ ] ; }
docstring: Reference subfield contents and filter by index.
  
  @param SubfieldInterface $currentSubfieldSpec The current subfield spec
  
  @return array An array of referenced subfields
docstring_tokens: Reference subfield contents and filter by index .