public function getSubfields () 
    {
        if (func_num_args() === 0) {
            return $this->_subfields;
        } else {
            $selected = array();
            $codes = array();
            $subfields = $this->getSubfields();
            array_walk($subfields, function ($value, $index) use (&$codes) { $codes[$index] = $value->getCode(); });
            foreach (func_get_args() as $arg) {
                $index = array_search($arg, $codes, true);
                if ($index === false) {
                    $selected []= null;
                } else {
                    $selected []= $subfields[$index];
                    unset($codes[$index]);
                }
            }
            return $selected;
        }
    }
public function getSubfields () 
    {
        if (func_num_args() === 0) {
            return $this->_subfields;
        } else {
            $selected = array();
            $codes = array();
            $subfields = $this->getSubfields();
            array_walk($subfields, function ($value, $index) use (&$codes) { $codes[$index] = $value->getCode(); });
            foreach (func_get_args() as $arg) {
                $index = array_search($arg, $codes, true);
                if ($index === false) {
                    $selected []= null;
                } else {
                    $selected []= $subfields[$index];
                    unset($codes[$index]);
                }
            }
            return $selected;
        }
    }
public function getSubfields ( ) { if ( func_num_args ( ) === 0 ) { return $ this -> _subfields ; } else { $ selected = array ( ) ; $ codes = array ( ) ; $ subfields = $ this -> getSubfields ( ) ; array_walk ( $ subfields , function ( $ value , $ index ) use ( & $ codes ) { $ codes [ $ index ] = $ value -> getCode ( ) ; } ) ; foreach ( func_get_args ( ) as $ arg ) { $ index = array_search ( $ arg , $ codes , true ) ; if ( $ index === false ) { $ selected [ ] = null ; } else { $ selected [ ] = $ subfields [ $ index ] ; unset ( $ codes [ $ index ] ) ; } } return $ selected ; } }
Return the field's subfields.

Returns all subfields when called with no arguments.

Otherwise the returned array is constructed as follows:

Each argument is interpreted as a subfield code. The nth element of the
returned array maps to the nth argument in the function call and contains
NULL if the field does not have a subfield with the selected code, or the
subfield if it exists. In order to retrieve multiple subfields with an
identical code you repeat the subfield code in the argument list.

@return array Subfields
Return the field s subfields .