private function setIndexStartEnd($fieldIndex, $subfieldIndex = null)
    {
        foreach (['leftSubTerm', 'rightSubTerm'] as $side) {
            if (!($this->currentSubSpec[$side] instanceof CK\MARCspec\ComparisonStringInterface)) {
                // only set new index if subspec field tag equals spec field tag!!
                if ($this->spec['field']['tag'] == $this->currentSubSpec[$side]['field']['tag']) {
                    $this->currentSubSpec[$side]['field']->setIndexStartEnd($fieldIndex, $fieldIndex);
                    if (!is_null($subfieldIndex)) {
                        if ($this->currentSubSpec[$side]->offsetExists('subfields')) {
                            foreach ($this->currentSubSpec[$side]['subfields'] as $subfieldSpec) {
                                $subfieldSpec->setIndexStartEnd($subfieldIndex, $subfieldIndex);
                            }
                        }
                    }
                }
            }
        }
    }
private function setIndexStartEnd($fieldIndex, $subfieldIndex = null)
    {
        foreach (['leftSubTerm', 'rightSubTerm'] as $side) {
            if (!($this->currentSubSpec[$side] instanceof CK\MARCspec\ComparisonStringInterface)) {
                // only set new index if subspec field tag equals spec field tag!!
                if ($this->spec['field']['tag'] == $this->currentSubSpec[$side]['field']['tag']) {
                    $this->currentSubSpec[$side]['field']->setIndexStartEnd($fieldIndex, $fieldIndex);
                    if (!is_null($subfieldIndex)) {
                        if ($this->currentSubSpec[$side]->offsetExists('subfields')) {
                            foreach ($this->currentSubSpec[$side]['subfields'] as $subfieldSpec) {
                                $subfieldSpec->setIndexStartEnd($subfieldIndex, $subfieldIndex);
                            }
                        }
                    }
                }
            }
        }
    }
private function setIndexStartEnd ( $ fieldIndex , $ subfieldIndex = null ) { foreach ( [ 'leftSubTerm' , 'rightSubTerm' ] as $ side ) { if ( ! ( $ this -> currentSubSpec [ $ side ] instanceof CK \ MARCspec \ ComparisonStringInterface ) ) { // only set new index if subspec field tag equals spec field tag!! if ( $ this -> spec [ 'field' ] [ 'tag' ] == $ this -> currentSubSpec [ $ side ] [ 'field' ] [ 'tag' ] ) { $ this -> currentSubSpec [ $ side ] [ 'field' ] -> setIndexStartEnd ( $ fieldIndex , $ fieldIndex ) ; if ( ! is_null ( $ subfieldIndex ) ) { if ( $ this -> currentSubSpec [ $ side ] -> offsetExists ( 'subfields' ) ) { foreach ( $ this -> currentSubSpec [ $ side ] [ 'subfields' ] as $ subfieldSpec ) { $ subfieldSpec -> setIndexStartEnd ( $ subfieldIndex , $ subfieldIndex ) ; } } } } } } }
Sets the start and end index of the current spec
if it's an instance of CK\MARCspec\PositionOrRangeInterface.

@param object $spec          The current spec
@param int    $fieldIndex    the start/end index to set
@param int    $subfieldIndex the start/end index to set
Sets the start and end index of the current spec if it s an instance of CK \ MARCspec \ PositionOrRangeInterface .