public function getContents($spec, array $value = [])
    {
        if (!$value) {
            $value = $this->getData("$spec");
        }
        $substring = false;
        $charStart = null;
        $length = null;
        if ($spec->offsetExists('charStart')) {
            $substring = true;
            $charStart = $spec['charStart'];
            $length = $spec['charLength'] * 1;
            if ('#' === $charStart) {
                // negative index
                $charStart = $length * -1;
            }
        }
        array_walk(
            $value,
            function (&$val, $key) use ($substring, $charStart, $length) {
                /*
                * Convert to string
                */
                // leader
                if (is_string($val)) {
                    // value stays untouched
                } elseif ($val instanceof File_MARC_Data_Field) {
                    $val = $val->getContents();
                } else {
                    $val = $val->getData();
                }
                /*
                 * Get substring
                 */
                if ($substring) {
                    $val = substr($val, $charStart, $length);
                }
            }
        );

        return $value;
    }
public function getContents($spec, array $value = [])
    {
        if (!$value) {
            $value = $this->getData("$spec");
        }
        $substring = false;
        $charStart = null;
        $length = null;
        if ($spec->offsetExists('charStart')) {
            $substring = true;
            $charStart = $spec['charStart'];
            $length = $spec['charLength'] * 1;
            if ('#' === $charStart) {
                // negative index
                $charStart = $length * -1;
            }
        }
        array_walk(
            $value,
            function (&$val, $key) use ($substring, $charStart, $length) {
                /*
                * Convert to string
                */
                // leader
                if (is_string($val)) {
                    // value stays untouched
                } elseif ($val instanceof File_MARC_Data_Field) {
                    $val = $val->getContents();
                } else {
                    $val = $val->getData();
                }
                /*
                 * Get substring
                 */
                if ($substring) {
                    $val = substr($val, $charStart, $length);
                }
            }
        );

        return $value;
    }
public function getContents ( $ spec , array $ value = [ ] ) { if ( ! $ value ) { $ value = $ this -> getData ( "$spec" ) ; } $ substring = false ; $ charStart = null ; $ length = null ; if ( $ spec -> offsetExists ( 'charStart' ) ) { $ substring = true ; $ charStart = $ spec [ 'charStart' ] ; $ length = $ spec [ 'charLength' ] * 1 ; if ( '#' === $ charStart ) { // negative index $ charStart = $ length * - 1 ; } } array_walk ( $ value , function ( & $ val , $ key ) use ( $ substring , $ charStart , $ length ) { /*
                * Convert to string
                */ // leader if ( is_string ( $ val ) ) { // value stays untouched } elseif ( $ val instanceof File_MARC_Data_Field ) { $ val = $ val -> getContents ( ) ; } else { $ val = $ val -> getData ( ) ; } /*
                 * Get substring
                 */ if ( $ substring ) { $ val = substr ( $ val , $ charStart , $ length ) ; } } ) ; return $ value ; }
Get referenced data content.

@param FieldInterface|SubfieldInterface          $spec  The corresponding spec
@param array[File_MARC_Field|File_MARC_Subfield] $value The value to reference

@return array[string] Array of referenced data content
Get referenced data content .