Record Driver Plugins
This page applies to VuFind 2.x and newer; for relevant 1.x information, see this page.
Record drivers are used to allow VuFind to interact with arbitrary metadata. Every record is represented by a driver object which wraps around the raw data (whether it comes from a Solr index, a third-party API response, or a database lookup). The record drivers implement consistent interfaces that allow other code to make use of data without concern for its origin.
See Supporting a New Metadata Format for some more background information.
Key Plugin Details
Default Namespace: \VuFind\RecordDriver
Base Class: \VuFind\RecordDriver\AbstractBase
Service Locator Configuration Section in module.config.php: ['vufind']['plugin_managers']['recorddriver']
Service Manager Name for Service Locator: VuFind\RecordDriverPluginManager (VuFind 2.x-4.x), VuFind\RecordDriver\PluginManager (VuFind 5.0+)
Template Name: VuFind loads record-related templates from the subdirectory of the RecordDriver folder of the current theme whose name corresponds with the class of the plugin (ignoring the namespace). Template directories inherit from one another in the same way that PHP classes inherit from one another – i.e. if VuFind\RecordDriver\SolrMarc is a subclass of VuFind\RecordDriver\SolrDefault, VuFind will first check RecordDriver\SolrMarc for templates, then fail over to RecordDriver\SolrDefault if they are missing.
Record driver templates have access to the object itself as $this→driver.
See the General Plugin Information page for more details on VuFind plugins.
- Record drivers used with the Solr index should be registered in the service locator with names that correspond with the record_format (or recordtype, in VuFind 5.x and earlier) value in the Solr index prepended with “Solr.” For example, if record_format = marc in the Solr index, a service called “SolrMarc” will be loaded from the service locator. If no matching service can be found, the SolrDefault service will be used.
- See the Record Driver Method Master List for more notes on how record drivers work.