src/File_MARC_Reference.php
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 [];
    }
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 [];
    }
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 [ ] ; }
Reference subfield contents and filter by index.

@param SubfieldInterface $currentSubfieldSpec The current subfield spec

@return array An array of referenced subfields
Reference subfield contents and filter by index .