====== 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: