src/Biblys/Isbn/Isbn.php
private function removePublisherCode($code)
    {

        // Get the seven first digits
        $first7 = substr($code, 0, 7);

        // Select the right set of rules according to the agency (product + country code)
        foreach ($this->getRanges()->getGroups() as $g) {
            if ($g['Prefix'] <> $this->getProduct().'-'.$this->getCountry()) {
                continue;
            }

            $rules = $g['Rules']['Rule'];
            $this->setAgency($g['Agency']);

            // Select the right rule
            foreach ($rules as $r) {
                $ra = explode('-', $r['Range']);
                if ($first7 < $ra[0] || $first7 > $ra[1]) {
                    continue;
                }

                $length = $r['Length'];
                $this->setPublisher(substr($code, 0, $length));
                $this->setPublication(substr($code, $length));
                break;
            }
            break;
        }
    }
private function removePublisherCode($code)
    {

        // Get the seven first digits
        $first7 = substr($code, 0, 7);

        // Select the right set of rules according to the agency (product + country code)
        foreach ($this->getRanges()->getGroups() as $g) {
            if ($g['Prefix'] <> $this->getProduct().'-'.$this->getCountry()) {
                continue;
            }

            $rules = $g['Rules']['Rule'];
            $this->setAgency($g['Agency']);

            // Select the right rule
            foreach ($rules as $r) {
                $ra = explode('-', $r['Range']);
                if ($first7 < $ra[0] || $first7 > $ra[1]) {
                    continue;
                }

                $length = $r['Length'];
                $this->setPublisher(substr($code, 0, $length));
                $this->setPublication(substr($code, $length));
                break;
            }
            break;
        }
    }
private function removePublisherCode ( $ code ) { // Get the seven first digits $ first7 = substr ( $ code , 0 , 7 ) ; // Select the right set of rules according to the agency (product + country code) foreach ( $ this -> getRanges ( ) -> getGroups ( ) as $ g ) { if ( $ g [ 'Prefix' ] <> $ this -> getProduct ( ) . '-' . $ this -> getCountry ( ) ) { continue ; } $ rules = $ g [ 'Rules' ] [ 'Rule' ] ; $ this -> setAgency ( $ g [ 'Agency' ] ) ; // Select the right rule foreach ( $ rules as $ r ) { $ ra = explode ( '-' , $ r [ 'Range' ] ) ; if ( $ first7 < $ ra [ 0 ] || $ first7 > $ ra [ 1 ] ) { continue ; } $ length = $ r [ 'Length' ] ; $ this -> setPublisher ( substr ( $ code , 0 , $ length ) ) ; $ this -> setPublication ( substr ( $ code , $ length ) ) ; break ; } break ; } }
Remove and save Publisher Code and Publication Code
Remove and save Publisher Code and Publication Code