public function parseSubjectAddedEntry(QuiteSimpleXmlElement &$node)
    {
        $out = array('term' => '', 'vocabulary' => null);
        $vocabularies = array(
            '0' => 'lcsh',
            '1' => 'lccsh', // LC subject headings for children's literature
            '2' => 'mesh', // Medical Subject Headings
            '3' => 'atg', // National Agricultural Library subject authority file (?)
            // 4 : unknown
            '5' => 'cash', // Canadian Subject Headings
            '6' => 'rvm', // Répertoire de vedettes-matière
            // 7: Source specified in subfield $2
        );
        $ind2 = $node->attr('ind2');

        $id = $node->text('marc:subfield[@code="0"]');
        $out['id'] = empty($id) ? null : $id;

        if (isset($vocabularies[$ind2])) {
            $out['vocabulary'] = $vocabularies[$ind2];
        } elseif ($ind2 == '7') {
            $vocab = $node->text('marc:subfield[@code="2"]');
            if (!empty($vocab)) {
                $out['vocabulary'] = $vocab;
            }
        } elseif ($ind2 == '4') {
            $this->parseAuthority($node->text('marc:subfield[@code="0"]'), $out);
        }

        $out['parts'] = array();
        $subdivtypes = array(
            'v' => 'form',
            'x' => 'general',
            'y' => 'chronologic',
            'z' => 'geographic',
        );
        foreach ($node->all('marc:subfield') as $subdiv) {
            $code = $subdiv->attr('code');
            if (in_array($code, array_keys($subdivtypes))) {
                $subdiv = trim($subdiv, '.');
                $out['parts'][] = array('value' => $subdiv, 'type' => $subdivtypes[$code]);
                $out['term'] .= self::$subfieldSeparator . $subdiv;
            }
        }

        return $out;
    }
public function parseSubjectAddedEntry(QuiteSimpleXmlElement &$node)
    {
        $out = array('term' => '', 'vocabulary' => null);
        $vocabularies = array(
            '0' => 'lcsh',
            '1' => 'lccsh', // LC subject headings for children's literature
            '2' => 'mesh', // Medical Subject Headings
            '3' => 'atg', // National Agricultural Library subject authority file (?)
            // 4 : unknown
            '5' => 'cash', // Canadian Subject Headings
            '6' => 'rvm', // Répertoire de vedettes-matière
            // 7: Source specified in subfield $2
        );
        $ind2 = $node->attr('ind2');

        $id = $node->text('marc:subfield[@code="0"]');
        $out['id'] = empty($id) ? null : $id;

        if (isset($vocabularies[$ind2])) {
            $out['vocabulary'] = $vocabularies[$ind2];
        } elseif ($ind2 == '7') {
            $vocab = $node->text('marc:subfield[@code="2"]');
            if (!empty($vocab)) {
                $out['vocabulary'] = $vocab;
            }
        } elseif ($ind2 == '4') {
            $this->parseAuthority($node->text('marc:subfield[@code="0"]'), $out);
        }

        $out['parts'] = array();
        $subdivtypes = array(
            'v' => 'form',
            'x' => 'general',
            'y' => 'chronologic',
            'z' => 'geographic',
        );
        foreach ($node->all('marc:subfield') as $subdiv) {
            $code = $subdiv->attr('code');
            if (in_array($code, array_keys($subdivtypes))) {
                $subdiv = trim($subdiv, '.');
                $out['parts'][] = array('value' => $subdiv, 'type' => $subdivtypes[$code]);
                $out['term'] .= self::$subfieldSeparator . $subdiv;
            }
        }

        return $out;
    }
public function parseSubjectAddedEntry ( QuiteSimpleXmlElement & $ node ) { $ out = array ( 'term' => '' , 'vocabulary' => null ) ; $ vocabularies = array ( '0' => 'lcsh' , '1' => 'lccsh' , // LC subject headings for children's literature '2' => 'mesh' , // Medical Subject Headings '3' => 'atg' , // National Agricultural Library subject authority file (?) // 4 : unknown '5' => 'cash' , // Canadian Subject Headings '6' => 'rvm' , // Répertoire de vedettes-matière // 7: Source specified in subfield $2 ) ; $ ind2 = $ node -> attr ( 'ind2' ) ; $ id = $ node -> text ( 'marc:subfield[@code="0"]' ) ; $ out [ 'id' ] = empty ( $ id ) ? null : $ id ; if ( isset ( $ vocabularies [ $ ind2 ] ) ) { $ out [ 'vocabulary' ] = $ vocabularies [ $ ind2 ] ; } elseif ( $ ind2 == '7' ) { $ vocab = $ node -> text ( 'marc:subfield[@code="2"]' ) ; if ( ! empty ( $ vocab ) ) { $ out [ 'vocabulary' ] = $ vocab ; } } elseif ( $ ind2 == '4' ) { $ this -> parseAuthority ( $ node -> text ( 'marc:subfield[@code="0"]' ) , $ out ) ; } $ out [ 'parts' ] = array ( ) ; $ subdivtypes = array ( 'v' => 'form' , 'x' => 'general' , 'y' => 'chronologic' , 'z' => 'geographic' , ) ; foreach ( $ node -> all ( 'marc:subfield' ) as $ subdiv ) { $ code = $ subdiv -> attr ( 'code' ) ; if ( in_array ( $ code , array_keys ( $ subdivtypes ) ) ) { $ subdiv = trim ( $ subdiv , '.' ) ; $ out [ 'parts' ] [ ] = array ( 'value' => $ subdiv , 'type' => $ subdivtypes [ $ code ] ) ; $ out [ 'term' ] .= self :: $ subfieldSeparator . $ subdiv ; } } return $ out ; }
Parses common elements in subject added entry fields 600-655.

@param \Danmichaelo\QuiteSimpleXMLElement\QuiteSimpleXMLElement $node

@return array
Parses common elements in subject added entry fields 600 - 655 .