VuFind API Documentation

MarcAdvancedTrait

Functions to add advanced MARC-driven functionality to a record driver already powered by the standard index spec. Depends upon MarcReaderTrait.

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

author

Ere Maijala ere.maijala@helsinki.fi

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$subjectFields  : array<string|int, mixed>
Fields that may contain subject headings, and their descriptions
$subjectSources  : array<string|int, mixed>
Mappings from subject source indicators (2nd indicator of subject fields in MARC 21) to the their codes.
$xmlType  : string
Type to export in getXML().
getAccessRestrictions()  : array<string|int, mixed>
Get access restriction notes for the record.
getAllRecordLinks()  : null|array<string|int, mixed>
Get all record links related to the current record. Each link is returned as array.
getAllSubjectHeadings()  : array<string|int, mixed>
Get all subject headings associated with this record. Each heading is returned as an array of chunks, increasing from least specific to most specific.
getAwards()  : array<string|int, mixed>
Get award notes for the record.
getBibliographicLevel()  : string
Get the bibliographic level of the current record.
getBibliographyNotes()  : array<string|int, mixed>
Get notes on bibliography content.
getCleanISMN()  : mixed
Return first ISMN found for this record, or false if no one found
getCleanNBN()  : mixed
Return first national bibliography number found, or false if not found
getConsortialIDs()  : array<string|int, mixed>
Return the list of "source records" for this consortial record.
getFilteredXML()  : string
Return full record as filtered XML for public APIs.
getFindingAids()  : array<string|int, mixed>
Get notes on finding aids related to the record.
getFormattedMarcDetails()  : array<string|int, mixed>
Get Status/Holdings Information from the internally stored MARC Record (support method used by the NoILS driver).
getFullTitlesAltScript()  : array<string|int, mixed>
Get the full titles of the record including section and part information in alternative scripts.
getGeneralNotes()  : array<string|int, mixed>
Get general notes on the record.
getHierarchicalPlaceNames()  : array<string|int, mixed>
Get hierarchical place names (MARC field 752)
getHumanReadablePublicationDates()  : array<string|int, mixed>
Get human readable publication dates for display purposes (may not be suitable for computer processing -- use getPublicationDates() for that).
getNewerTitles()  : array<string|int, mixed>
Get an array of newer titles for the record.
getPlacesOfPublication()  : array<string|int, mixed>
Get the item's places of publication.
getPlayingTimes()  : array<string|int, mixed>
Get an array of playing times for the record (if applicable).
getPreviousTitles()  : array<string|int, mixed>
Get an array of previous titles for the record.
getProductionCredits()  : array<string|int, mixed>
Get credits of people involved in production of the item.
getPublicationFrequency()  : array<string|int, mixed>
Get an array of publication frequency information.
getRDFXML()  : mixed
Get an XML RDF representation of the data in this record.
getRelationshipNotes()  : array<string|int, mixed>
Get an array of strings describing relationships to other items.
getSeries()  : array<string|int, mixed>
Get an array of all series names containing the record. Array entries may be either the name string, or an associative array with 'name' and 'number' keys.
getShortTitlesAltScript()  : array<string|int, mixed>
Get the short (pre-subtitle) title of the record in alternative scripts.
getSubtitlesAltScript()  : array<string|int, mixed>
Get the subtitle of the record in alternative script.
getSummary()  : array<string|int, mixed>
Get an array of summary strings for the record.
getSystemDetails()  : array<string|int, mixed>
Get an array of technical details on the item represented by the record.
getTargetAudienceNotes()  : array<string|int, mixed>
Get an array of note about the record's target audience.
getTitlesAltScript()  : array<string|int, mixed>
Get the full titles of the record in alternative scripts.
getTitleSection()  : string
Get the text of the part/section portion of the title.
getTitleSectionsAltScript()  : array<string|int, mixed>
Get the text of the part/section portion of the title in alternative scripts.
getTitleStatement()  : string
Get the statement of responsibility that goes with the title (i.e. "by John Smith").
getTOC()  : array<string|int, mixed>
Get an array of lines from the table of contents.
getURLs()  : array<string|int, mixed>
Return an array of associative URL arrays with one or more of the following keys:
getXML()  : mixed
Return an XML representation of the record using the specified format.
extractSingleMarcDetail()  : string|bool
Support method for getFormattedMarcDetails() -- extract a single result
getAllSubjectHeadingsNumericalOrder()  : array<string|int, mixed>
Get all subject headings associated with this record. Each heading is returned as an array of chunks, increasing from least specific to most specific. Sorted numerically on marc fields.
getAllSubjectHeadingsRecordOrder()  : array<string|int, mixed>
Get all subject headings associated with this record. Each heading is returned as an array of chunks, increasing from least specific to most specific. Sorted in the same way it is saved for the record.
getFieldData()  : array<string|int, mixed>|bool
Returns the array element for the 'getAllRecordLinks' method
getIdFromLinkingField()  : string|bool
Returns an id extracted from the identifier subfield passed in
getRecordLinkNote()  : string
Support method for getFieldData() -- factor the relationship indicator into the field number where relevant to generate a note to associate with a record link.
getSeriesFromMARC()  : array<string|int, mixed>
Support method for getSeries() -- given a field specification, look for series information in the MARC record.
processSubjectHeadings()  : array<string|int, mixed>|null
Get subject headings of a given record field.

Properties

$subjectFields

Fields that may contain subject headings, and their descriptions

protected array<string|int, mixed> $subjectFields = ['600' => 'personal name', '610' => 'corporate name', '611' => 'meeting name', '630' => 'uniform title', '648' => 'chronological', '650' => 'topic', '651' => 'geographic', '653' => '', '655' => 'genre/form', '656' => 'occupation']

$subjectSources

Mappings from subject source indicators (2nd indicator of subject fields in MARC 21) to the their codes.

protected array<string|int, mixed> $subjectSources = ['0' => 'lcsh', '1' => 'lcshac', '2' => 'mesh', '3' => 'nal', '4' => 'unknown', '5' => 'cash', '6' => 'rvm']
Tags
link

Subject field docs

link

Code list

$xmlType

Type to export in getXML().

protected string $xmlType = 'Bibliographic'

Methods

getAccessRestrictions()

Get access restriction notes for the record.

public getAccessRestrictions() : array<string|int, mixed>
Return values
array<string|int, mixed>

Get all record links related to the current record. Each link is returned as array.

public getAllRecordLinks() : null|array<string|int, mixed>

Format: array( array( 'title' => label_for_title 'value' => link_name 'link' => link_URI ), ... )

Return values
null|array<string|int, mixed>

getAllSubjectHeadings()

Get all subject headings associated with this record. Each heading is returned as an array of chunks, increasing from least specific to most specific.

public getAllSubjectHeadings([bool $extended = false ]) : array<string|int, mixed>
Parameters
$extended : bool = false

Whether to return a keyed array with the following keys:

  • heading: the actual subject heading chunks
  • type: heading type
  • source: source vocabulary
Return values
array<string|int, mixed>

getAwards()

Get award notes for the record.

public getAwards() : array<string|int, mixed>
Return values
array<string|int, mixed>

getBibliographicLevel()

Get the bibliographic level of the current record.

public getBibliographicLevel() : string
Return values
string

getBibliographyNotes()

Get notes on bibliography content.

public getBibliographyNotes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCleanISMN()

Return first ISMN found for this record, or false if no one found

public getCleanISMN() : mixed
Return values
mixed

getCleanNBN()

Return first national bibliography number found, or false if not found

public getCleanNBN() : mixed
Return values
mixed

getConsortialIDs()

Return the list of "source records" for this consortial record.

public getConsortialIDs() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFilteredXML()

Return full record as filtered XML for public APIs.

public getFilteredXML() : string
Return values
string

getFindingAids()

Get notes on finding aids related to the record.

public getFindingAids() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFormattedMarcDetails()

Get Status/Holdings Information from the internally stored MARC Record (support method used by the NoILS driver).

public getFormattedMarcDetails(string $defaultField, array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$defaultField : string

The MARC Field to retrieve if $data commands do not request something more specific

$data : array<string|int, mixed>

The type of data to retrieve from the MARC field; an array of pipe-delimited commands where the first part determines the data retrieval mode, the second part provides further instructions, and the optional third part provides a field to override $defaultField; supported modes: "msg" (for a hard-coded message) and "marc" (for fetching subfield data)

Return values
array<string|int, mixed>

getFullTitlesAltScript()

Get the full titles of the record including section and part information in alternative scripts.

public getFullTitlesAltScript() : array<string|int, mixed>
Return values
array<string|int, mixed>

getGeneralNotes()

Get general notes on the record.

public getGeneralNotes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHierarchicalPlaceNames()

Get hierarchical place names (MARC field 752)

public getHierarchicalPlaceNames() : array<string|int, mixed>

Returns an array of formatted hierarchical place names, consisting of all alpha-subfields, concatenated for display

Return values
array<string|int, mixed>

getHumanReadablePublicationDates()

Get human readable publication dates for display purposes (may not be suitable for computer processing -- use getPublicationDates() for that).

public getHumanReadablePublicationDates() : array<string|int, mixed>
Return values
array<string|int, mixed>

getNewerTitles()

Get an array of newer titles for the record.

public getNewerTitles() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPlacesOfPublication()

Get the item's places of publication.

public getPlacesOfPublication() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPlayingTimes()

Get an array of playing times for the record (if applicable).

public getPlayingTimes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPreviousTitles()

Get an array of previous titles for the record.

public getPreviousTitles() : array<string|int, mixed>
Return values
array<string|int, mixed>

getProductionCredits()

Get credits of people involved in production of the item.

public getProductionCredits() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPublicationFrequency()

Get an array of publication frequency information.

public getPublicationFrequency() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRDFXML()

Get an XML RDF representation of the data in this record.

public getRDFXML() : mixed
Return values
mixed

XML RDF data (empty if unsupported or error).

getRelationshipNotes()

Get an array of strings describing relationships to other items.

public getRelationshipNotes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSeries()

Get an array of all series names containing the record. Array entries may be either the name string, or an associative array with 'name' and 'number' keys.

public getSeries() : array<string|int, mixed>
Return values
array<string|int, mixed>

getShortTitlesAltScript()

Get the short (pre-subtitle) title of the record in alternative scripts.

public getShortTitlesAltScript() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSubtitlesAltScript()

Get the subtitle of the record in alternative script.

public getSubtitlesAltScript() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSummary()

Get an array of summary strings for the record.

public getSummary() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSystemDetails()

Get an array of technical details on the item represented by the record.

public getSystemDetails() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTargetAudienceNotes()

Get an array of note about the record's target audience.

public getTargetAudienceNotes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTitlesAltScript()

Get the full titles of the record in alternative scripts.

public getTitlesAltScript() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTitleSection()

Get the text of the part/section portion of the title.

public getTitleSection() : string
Return values
string

getTitleSectionsAltScript()

Get the text of the part/section portion of the title in alternative scripts.

public getTitleSectionsAltScript() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTitleStatement()

Get the statement of responsibility that goes with the title (i.e. "by John Smith").

public getTitleStatement() : string
Return values
string

getTOC()

Get an array of lines from the table of contents.

public getTOC() : array<string|int, mixed>
Return values
array<string|int, mixed>

getURLs()

Return an array of associative URL arrays with one or more of the following keys:

public getURLs() : array<string|int, mixed>
    • desc: URL description text to display (optional)
      url: fully-formed URL (required if 'route' is absent)
      route: VuFind route to build URL with (required if 'url' is absent)
      routeParams: Parameters for route (optional)
      queryString: Query params to append after building route (optional)
  • Return values
    array<string|int, mixed>

    getXML()

    Return an XML representation of the record using the specified format.

    public getXML(string $format[, string $baseUrl = null ][, RecordLinker $linker = null ]) : mixed

    Return false if the format is unsupported.

    Parameters
    $format : string

    Name of format to use (corresponds with OAI-PMH metadataPrefix parameter).

    $baseUrl : string = null

    Base URL of host containing VuFind (optional; may be used to inject record URLs into XML when appropriate).

    $linker : RecordLinker = null

    Record linker helper (optional; may be used to inject record URLs into XML when appropriate).

    Return values
    mixed

    XML, or false if format unsupported.

    extractSingleMarcDetail()

    Support method for getFormattedMarcDetails() -- extract a single result

    protected extractSingleMarcDetail(array<string|int, mixed> $currentField, array<string|int, mixed> $details) : string|bool
    Parameters
    $currentField : array<string|int, mixed>

    Result from MarcReader::getFields

    $details : array<string|int, mixed>

    Parsed instructions from getFormattedMarcDetails()

    Return values
    string|bool

    getAllSubjectHeadingsNumericalOrder()

    Get all subject headings associated with this record. Each heading is returned as an array of chunks, increasing from least specific to most specific. Sorted numerically on marc fields.

    protected getAllSubjectHeadingsNumericalOrder([bool $extended = false ]) : array<string|int, mixed>
    Parameters
    $extended : bool = false

    Whether to return a keyed array with the following keys:

    • heading: the actual subject heading chunks
    • type: heading type
    • source: source vocabulary
    Return values
    array<string|int, mixed>

    getAllSubjectHeadingsRecordOrder()

    Get all subject headings associated with this record. Each heading is returned as an array of chunks, increasing from least specific to most specific. Sorted in the same way it is saved for the record.

    protected getAllSubjectHeadingsRecordOrder([bool $extended = false ]) : array<string|int, mixed>
    Parameters
    $extended : bool = false

    Whether to return a keyed array with the following keys:

    • heading: the actual subject heading chunks
    • type: heading type
    • source: source vocabulary
    Return values
    array<string|int, mixed>

    getFieldData()

    Returns the array element for the 'getAllRecordLinks' method

    protected getFieldData(array<string|int, mixed> $field) : array<string|int, mixed>|bool
    Parameters
    $field : array<string|int, mixed>

    Field to examine

    Return values
    array<string|int, mixed>|bool

    Array on success, boolean false if no valid link could be found in the data.

    getIdFromLinkingField()

    Returns an id extracted from the identifier subfield passed in

    protected getIdFromLinkingField(string $idField[, string $prefix = null ][, bool $raw = false ]) : string|bool
    Parameters
    $idField : string

    MARC subfield containing id information

    $prefix : string = null

    Prefix to search for in id field

    $raw : bool = false

    Return raw match, or normalize?

    Return values
    string|bool

    ID on success, false on failure

    getRecordLinkNote()

    Support method for getFieldData() -- factor the relationship indicator into the field number where relevant to generate a note to associate with a record link.

    protected getRecordLinkNote(array<string|int, mixed> $field) : string
    Parameters
    $field : array<string|int, mixed>

    Field to examine

    Return values
    string

    getSeriesFromMARC()

    Support method for getSeries() -- given a field specification, look for series information in the MARC record.

    protected getSeriesFromMARC(array<string|int, mixed> $fieldInfo) : array<string|int, mixed>
    Parameters
    $fieldInfo : array<string|int, mixed>

    Associative array of field => subfield information (used to find series name)

    Return values
    array<string|int, mixed>

    processSubjectHeadings()

    Get subject headings of a given record field.

    protected processSubjectHeadings(array<string|int, mixed> $field, bool $extended, string $fieldType) : array<string|int, mixed>|null

    The heading is returned as a chunk, increasing from least specific to most specific.

    Parameters
    $field : array<string|int, mixed>

    field to handle

    $extended : bool

    Whether to return a keyed array with the following keys:

    • heading: the actual subject heading chunks - type: heading type - source: source vocabulary
    $fieldType : string

    Type of the field

    Return values
    array<string|int, mixed>|null

    Search results