Stud.IP
6.0
|
Public Member Functions | |
getId () | |
getType ($format='name') | |
getTitle ($format='short') | |
getAuthorNames () | |
getIssueDate ($year_only=false) | |
getIdentifiers () | |
filterCslFieldsByType () | |
toArray () | |
toJson () | |
fillEmptyCslFields () | |
isEqualTo (LibraryDocument $other) | |
getInfoTemplate ($format='short') | |
getSearchDescription () | |
getIcon () | |
Static Public Member Functions | |
static | createFromArray (array $data=[]) |
static | createFromJson (string $json_string="") |
Data Fields | |
$id = '' | |
$opac_document_id = '' | |
$opac_link = '' | |
$type = '' | |
$csl_data = [] | |
$catalog = '' | |
$datafields | |
$search_params = [] | |
This class represents a document from a library.
|
static |
Creates a LibraryDocument instance from an associative array.
array | $data | An associative array containing data for a LibraryDocument instance. |
|
static |
Creates a LibraryDocument instance from JSON data.
string | $json_string | A JSON string containing data for a LibraryDocument instance. |
fillEmptyCslFields | ( | ) |
Fills or creates empty or missing CSL data fields that may be required when rendering the CSL data.
filterCslFieldsByType | ( | ) |
Filters the CSL data fields by the document type. Only those CSL fields that are specified in library_config.inc.php for the document type are kept.
getAuthorNames | ( | ) |
getIcon | ( | ) |
getId | ( | ) |
Generates an ID for the document.
getIdentifiers | ( | ) |
getInfoTemplate | ( | $format = 'short' | ) |
getIssueDate | ( | $year_only = false | ) |
Returns a string with the issue date.
bool | $year_only | Whether to return only the year of the date (true) or the whole date (false). Defaults to false. |
getSearchDescription | ( | ) |
Creates a descriptive text of the search parameters that lead to the retrieval of this document.
getTitle | ( | $format = 'short' | ) |
Returns the title of the document as string.
string | $format | The format of the title. 'short' means that only the title is returned. 'long' means that the author, the year and the title are concatenated into one string. 'long-comma' means that the author, the title and the year are concatenated in that order, only separated by a comma. |
getType | ( | $format = 'name' | ) |
Returns the type of the document as string.
isEqualTo | ( | LibraryDocument | $other | ) |
Determines if this document is equal to another document. Equality is determined by comparing various ID fields and as a last resort, the title, author and year are compared.
LibraryDocument | $other | Another library document that shall be compared to this document. |
toArray | ( | ) |
Converts this LibraryDocument to an associative array.
toJson | ( | ) |
Converts this LibraryDocument to JSON data.
$catalog = '' |
The name of the catalog from which the document has been retrieved.
$csl_data = [] |
The CSL datafields.
$datafields |
Other data that cannot be stored in the $csl_data array.
$id = '' |
An unique ID of the document.
$opac_document_id = '' |
The OPAC ID of the document.
$opac_link = '' |
The link to the document page in the OPAC system.
$search_params = [] |
The search parameter that have been used to retrieve this item.
$type = '' |
The CSL document type.