About Features Downloads Getting Started Documentation Events Support GitHub

Site Tools


development:architecture:record_driver_method_master_list

This is an old revision of the document!


Record Driver Method Master List

VuFind is designed to be as flexible as possible with regard to record data – it will often try to find data elements and use them if they are available, gracefully degrading if they are not. In order to maximize use of these features, it is important that different record drivers try to use the same method names for obtaining key pieces of data and that these methods return the same data types.

This page is a list of commonly-used record driver methods. Before creating a new method, you should check this list and see if you can conform to an existing precedent.

Base

These methods are defined in the record driver base class, so they are always available.

Method Name Params Output Description
addTags $user (\VuFind\Db\Row\User) void Add tags to the record.

$user - The user posting the tag

$tags - The user-provided tags
$tags (array)
getBreadcrumb none string Breadcrumb text to represent this record. Get text that can be displayed to represent this record in breadcrumbs.
getCitationFormats none array Strings representing citation formats. Get an array of strings representing citation formats supported by this record's data (empty if none). For possible legal values, see the Citation view helper. Starting with VuFind 2.3, this list can be filtered using config.ini settings; the unfiltered list should be defined by getSupportedCitationFormats().
getComments none array Get comments associated with this record.
getContainingLists $user_id (int) array Get a list of lists containing this record.

$user_id - ID of user to load tags from (null for all users)
getExtraDetail $key (string) mixed Retrieve a piece of supplemental information stored using setExtraDetail().

$key - Name of stored information
getListNotes $list_id (int) array Get notes associated with this record in user lists.

$list_id - ID of list to load tags from (null for all lists)

$user_id - ID of user to load tags from (null for all users)
$user_id (int)
getRawData none mixed Get the raw data contained in the driver (primarily for use in staff view and autocomplete; avoid using whenever possible).
getRelated $factory (\VuFind\Related\PluginManager) array Return an array of related record suggestion objects (implementing the \VuFind\Related\Interface) based on the current record.

$factory - Related module plugin factory

$types - Array of relationship types to load; each entry should be a partial class name (i.e. 'Similar' or 'Editions') optionally followed by a colon-separated list of parameters to pass to the constructor. If the parameter is set to null instead of an array, default settings will be loaded from config.ini. :!: Removed in VuFind 5.0 (logic moved to VuFind\View\Helper\Root\Related)
$types (array)
getResourceSource none string Get the source value used to identify resources of this type in the database – prior to VuFind 3.0, this sometimes differed from the value returned by getSourceIdentifier. :!: Deprecated as of VuFind 3.0 – use getSourceIdentifier() instead.
getSortTitle none string Get a sortable title for the record (i.e. no leading articles).
getSourceIdentifier none string Get the source value (search backend identifier) used to identify resources of this type in the database.
getSupportedCitationFormats none array Added in VuFind 2.3 - an unfiltered list of citation formats supported by this record; see getCitationFormats above for more details.
getTags $list_id (int) array Get tags associated with this record.

$list_id - ID of list to load tags from (null for all lists)

$user_id - ID of user to load tags from (null for all users)

$sort - Sort type ('count' or 'tag')
$user_id (int)
$sort (string)
getUniqueID none string Unique identifier. Return the unique identifier of this record for retrieving additional information (like tags and user comments) from the external MySQL database.
openURLActive (deprecated) $area (string) bool Does the OpenURL configuration indicate that we should display OpenURLs in the specified context?

$area - 'results', 'record' or 'holdings'
:!: removed in VuFind 2.5
replaceURLsWithOpenURL (deprecated) none bool Should we display regular URLs when an OpenURL is present?
:!: removed in VuFind 2.5
saveToFavorites $params (array) void Save this record to the user's favorites.

$params - Array with some or all of these keys: <ul> <li>mytags - Tag array to associate with record (optional)<li> <li>notes - Notes to associate with record (optional)<li> <li>list - ID of list to save record into (omit to create new list)<li> <ul>

$user - The user saving the record
$user (\VuFind\Db\Row\User)
setExtraDetail $key (string) void Store a piece of supplemental information in the record driver.

$key - Name of stored information

$val - Information to store
$val (mixed)
setRawData $data (mixed) void Set the raw data to be used by the driver. This must be called after construction but prior to using other methods. The nature of the raw data doesn't matter as long as other driver methods are able to interpret it. Most record drivers in VuFind use an associative array based on the Solr schema.
supportsAjaxStatus none bool Returns true if the record supports real-time AJAX status lookups.
supportsCoinsOpenUrl none bool Returns true if OpenURLs may be used for generating COinS from the current record. See also supportsOpenUrl below. Added in VuFind 2.5.
supportsOpenUrl none bool Returns true if OpenURLs may be used for linking from the current record. Setting this to false does not suppress the display of COinS (see supportsCoinsOpenUrl). Added in VuFind 2.5.
tryMethod $method (string) mixed Try to call the requested method and return null if it is unavailable; this is useful for checking for the existence of get methods for particular types of data without causing fatal errors.

$method - Name of method to call.

$params - Array of parameters to pass to method.
$params (array)

Extended

These methods are defined in some, but not all, record drivers. If you need to add functionality to a driver, check this list to see if there is an existing method signature you can adopt. If you need to obtain values from one of these methods and are not sure of the type of your object, use tryMethod() to avoid fatal errors.

Method Name Params Output Description
attachILS $ils (\VuFind\ILS\Connection) void Inject dependencies to allow interaction with the ILS for real-time functionality (intended for use within plugin manager).
$holdLogic (\VuFind\ILS\Logic\Holds)
$titleHoldLogic (\VuFind\ILS\Logic\TitleHolds)
exportDisabled $format (string) bool Indicate whether or not the specified export format is disallowed by this driver.
getAccessRestrictions none array Get access restriction notes for the record.
getAllRecordLinks none null/array Get all record links related to the current record. Each link is returned as array. NB: to use this method you must override it. Format: <code> array( array( 'title' ⇒ label_for_title 'value' ⇒ link_name 'link' ⇒ link_URI ), … ) <code>
getAllSubjectHeadings $extended (bool) array Get all subject headings associated with this record. When $extended is false (the default, and the only option prior to release 4.0), each heading is returned as an array of chunks, increasing from least specific to most specific. When true, each heading is returned as an associative array with heading, source and type keys.
getAwards none array Get award notes for the record.
getBibliographicLevel none string Get the bibliographic level of the current record.
getBibliographyNotes none array Get notes on bibliography content.
getCallNumber none string Get the call number associated with the record (empty string if none).
getCleanDOI none mixed Return the first valid DOI found in the record (false if none).
getCleanISBN none mixed Return the first valid ISBN found in the record (favoring ISBN-10 over ISBN-13 when possible).
getCleanISSN none mixed Get just the base portion of the first listed ISSN (or false if no ISSNs).
getCleanOCLCNum none mixed Get just the first listed OCLC Number (or false if none available).
getCleanUPC none mixed Get just the first listed UPC (or false if none available).
getContainerEndPage none string Get the end page of the item that contains this record.
getContainerIssue none string Get the issue of the item that contains this record (i.e. MARC 773l of a journal).
getContainerReference none string Get a full, free-form reference to the context of the item that contains this record (i.e. volume, year, issue, pages).
getContainerStartPage none string Get the start page of the item that contains this record (i.e. MARC 773q of a journal).
getContainerTitle none string Get the title of the item that contains this record (i.e. MARC 773s of a journal).
getContainerVolume none string Get the volume of the item that contains this record (i.e. MARC 773v of a journal).
getContainingCollections none array Get an associative array (id ⇒ title) of collections containing this record.
getCorporateAuthor none string Get the main corporate author (if any) for the record. :!: Removed in VuFind 3.0.
getCorporateAuthors none array Get the corporate authors (if any) for the record. Introduced in VuFind 3.0.
getCorporateAuthorRoles none array Get the roles of corporate authors (if any) for the record. Introduced in VuFind 3.0.
getCourse none string Get the course.
getCourseId none string Get the course ID.
getDateSpan none array Get the date coverage for a record which spans a period of time (i.e. a journal). Use getPublicationDates for publication dates of particular monographic items.
getDeduplicatedAuthors none array Deduplicate author information into associative array with main/corporate/secondary keys.
getDepartment none string Get the department.
getDepartmentId none string Get the department ID.
getDeweyCallNumber none string Get the Dewey call number associated with this record (empty string if none).
getEdition none string Get the edition of the current record.
getFieldArray $field (string) array Return an array of all values extracted from the specified fieldsubfield combination. If multiple subfields are specified and $concat is true, they will be concatenated together in the order listed – each entry in the array will correspond with a single MARC field. If $concat is false, the return array will contain separate entries for separate subfields.

$field - The MARC field number to read

$subfields - The MARC subfield codes to read

$concat - Should we concatenate subfields?
$subfields (array)
$concat (bool)
getFieldData $field (File_MARC_Data_Field) array/bool Array on success, boolean false if no Returns the array element for the 'getAllRecordLinks' method

$field - Field to examine

$value - Field name for use in label
$value (string)
getFindingAids none array Get notes on finding aids related to the record.
getFirstFieldValue $field (string) string Get the first value matching the specified MARC field and subfields. If multiple subfields are specified, they will be concatenated together.

$field - The MARC field to read

$subfields - The MARC subfield codes to read
$subfields (array)
getFormats none array Get an array of all the formats associated with the record.
getFormattedMarcDetails $field (array) array Get Status/Holdings Information from the internally stored MARC Record (support method used by the NoILS driver).

$field - The MARC field to retrieve

$data - A keyed array of data to retrieve from subfields
$data (array)
getFullRecord none object Parse the full record, if required, and return it.
getGeneralNotes none array Get general notes on the record.
getHierarchyDriver none \VuFind\Hierarchy\Driver\AbstractBase or bool Get a hierarchy driver appropriate to the current object. (May be false if disabled/unavailable).
getHierarchyPositionsInParents none array Get the positions of this item within parent collections. Returns an array of parent ID ⇒ sequence number. :!: removed in VuFind 2.5; no longer needed
getHierarchyTopID none array Get an array of IDs representing tops of hierarchies containing this item
getHierarchyTopTitle none array Get an array of titles of hierarchies containing this item
getHierarchyTrees $hierarchyID (string) associative array of hierachy trees on success (id ⇒ title), false if no hierarchies found Get a list of hierarchy trees containing this record (optional parameter may be used to filter to a specific tree)
getHierarchyType none string or boolean Get the type of hierarchy used by this record (false for no hierarchy supported)
getHighlightedAuthor none string Get a highlighted author string, if available. :!: Removed in VuFind 3.0 in favor of getRawAuthorHighlights()
getHighlightedSnippet none mixed False if no snippet found, otherwise associative array Pick one line from the highlighted text (if any) to use as a snippet.
getHighlightedTitle none string Get a highlighted title string, if available.
getHumanReadablePublicationDates none array Similar to getPublicationDates() but in some cases returns a human-readable, display-oriented string instead of a value that has been normalized to allow computer processing. Added in VuFind 2.3.
getImageBasedOpenUrl none string When defined, overrides getOpenUrl() for links generated using dynamically-generated OpenURL-based images (see the dynamic_graphic setting in config.ini). Introduced in VuFind 2.5.
getInstitutions none array Get an array of institutions holding this record.
getInstructor none string Get the instructor.
getInstructorId none string Get the instructor ID.
getISBNs none array Get an array of all ISBNs associated with the record (may be empty).
getISSNs none array Get an array of all ISSNs associated with the record (may be empty).
getItemCount none int Get a count of items associated with this record.
getLCCN none string Get a LCCN, normalised according to info:lccn
getLanguages none array Get an array of all the languages associated with the record.
getLastIndexed none string Get a string representing the last date that the record was indexed.
getLongLat none string Get a comma-separated longitude,latitude string.
getMarcRecord none File_MARCBASE Get access to the raw File_MARC object.
getNewerTitles none array Get an array of newer titles for the record.
getOCLC none array Get the OCLC number(s) of the record.
getOpenURL / getOpenUrl none string OpenURL parameters. Get the OpenURL parameters to represent this record (useful for the title attribute of a COinS span tag).
:!: Renamed from getOpenURL to getOpenUrl in VuFind 2.5.
getPhysicalDescriptions none array Get an array of physical descriptions of the item.
getPlacesOfPublication none array Get the item's place of publication.
getPlayingTimes none array Get an array of playing times for the record (if applicable).
getPreviousTitles none array Get an array of previous titles for the record.
getPrimaryAuthor none string Get the main author of the record. :!: Use of this method is discouraged in VuFind 3.0 and later; use getPrimaryAuthors instead when possible.
getPrimaryAuthors none string Get the main authors of the record. Introduced in VuFind 3.0
getPrimaryAuthorsRoles none string Get the roles of the main authors of the record. Introduced in VuFind 3.0
getPrimaryAuthorsWithHighlighting none array Get primary author information, but with highlighting applied when applicable. Introduced in VuFind 3.0
getProductionCredits none array Get credits of people involved in production of the item.
getPublicationDates none array Get the publication dates of the record. See also getDateSpan().
getPublicationDetails none array Get an array of publication detail lines combining information from getPublicationDates(), getPublishers() and getPlacesOfPublication().
getPublicationFrequency none array Get an array of publication frequency information.
getPublishers none array Get the publishers of the record.
getRawAuthorHighlights none Get raw highlighting information for the primary author field. Introduced in VuFind 3.0; see also getPrimaryAuthorsWithHighlighting
getRawLCCN none string or bool get non-normalized LCCN for this record (or false if none).
getRDFXML none mixed XML RDF data (empty if unsupported or error). Get an XML RDF representation of the data in this record.
getRealTimeHistory none array Get an array of information about record history, obtained in real-time from the ILS.
getRealTimeHoldings none array Get an array of information about record holdings, obtained in real-time from the ILS.

$account - A \VuFind\Auth\Manager instance to use for checking logged-in status.
getRealTimeTitleHold none mixed A url if a hold is possible, boolean false if not Get a link for placing a title level hold.

$account - A \VuFind\Auth\Manager instance to use for checking logged-in status.
getRelationshipNotes none array Get an array of strings describing relationships to other items.
getSecondaryAuthors none array Get an array of all secondary authors (complementing getPrimaryAuthor()).
getSecondaryAuthorsRoles none string Get the roles of the secondary authors of the record. Introduced in VuFind 3.0
getSeeAlso none array Get the see also references for the record.
getSeries none array 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.
getSeriesFromMARC $fieldInfo (array) array Support method for getSeries() – given a field specification, look for series information in the MARC record.

$fieldInfo - Associative array of field ⇒ subfield information (used to find series name)
getShortTitle none string Get the short (pre-subtitle) title of the record.
getSnippetCaption $field (string) mixed Caption if found, false if none available. Given a Solr field name, return an appropriate caption.

$field - Solr field name
getSource none string Get the source (e.g. a particular database) of the record.
getSubfieldArray $currentField (object) array Return an array of non-empty subfield values found in the provided MARC field. If $concat is true, the array will contain either zero or one entries (empty array if no subfields found, subfield values concatenated together in specified order if found). If concat is false, the array will contain a separate entry for each subfield value found.

$currentField - Result from File_MARC::getFields.

$subfields - The MARC subfield codes to read

$concat - Should we concatenate subfields?
$subfields (array)
$concat (bool)
getSubtitle none string Get the subtitle of the record.
getSummary none array Get an array of summary strings for the record.
getSystemDetails none array Get an array of technical details on the item represented by the record.
getTOC none array Get an array of lines from the table of contents.
getTargetAudienceNotes none array Get an array of note about the record's target audience.
getThumbnail $size (array) string/array/bool Returns one of three things: a full URL to a thumbnail preview of the record if an image is available in an external system; an array of parameters to send to VuFind's internal cover generator if no fixed URL exists; or false if no thumbnail can be generated.
You can enable icons by including the parameter 'contenttype' (e.g. the record's format) in the returned array of parameters. VuFind will try to retrieve a cover based on the parameters but will fallback to icons if no cover can be found - if only parameters 'size' and 'contenttype' are returned display of icons is enforced (make sure that the icons are exactly named after the contenttypes, including case sensitivity, and reside in the theme's images/{$size}/ folder). For an example implementation refer to the Summon.php RecordDriver.

$size - Size of thumbnail (small, medium or large – small is default).
getTitle none string Get the full title of the record.
getTitleSection none string Get the text of the partsection portion of the title.
getTitleStatement none string Get the statement of responsibility that goes with the title (i.e. “by John Smith”).
getUPC none array Get the UPC(s) of the record.
getURLs none array Return an array of associative arrays representing URLs associated with this record. Each of these associative arrays MAY contain a 'desc' key with a description (URL will be displayed if description is absent) and MUST contain EITHER a 'url' key with a full URL OR 'route' / 'routeParams' / 'queryString' keys with details on how to build a URL using VuFind's routing system.
getUseFor none array Get the use for references for the record.
getXML $format (string) mixed XML, or false if format unsupported. Return an XML representation of the record using the specified format. Return false if the format is unsupported.

$format - Name of format to use (corresponds with OAI-PMH metadataPrefix parameter).
isCollection none bool Get the value of whether or not this is a collection level record
setHierarchyDriverManager $pm (\VuFind\Hierarchy\Driver\PluginManager) \VuFind\RecordDriver\AbstractBase Inject a hierarchy driver plugin manager (required for successful operation of getHierarchyDriver); implements a fluent interface.
development/architecture/record_driver_method_master_list.1529955845.txt.gz · Last modified: 2018/06/25 19:44 by demiankatz