\O3PO_Bibentry

A class to represent bibliography entries.

Summary

Methods
Properties
Constants
__construct()
get()
get_surnames()
get_formated_authors()
get_formated_html()
get_cite_as_text()
merge()
match()
merge_bibitem_arrays()
remove_duplicates()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$meta_data
$meta_data_fields
N/A

Properties

$meta_data

$meta_data : array

Array holding the meta-data of this bibtentry

Type

array — Array holding the meta-data of this bibtentry.

$meta_data_fields

$meta_data_fields : Array

Array of all supported meta-data fields

Type

Array — of all supported meta-data fields

Methods

__construct()

__construct(array  $meta_data = array()) 

Construct a bibtentry.

Only the entries in $meta_data whose keys are listed in $meta_data_fields are taken into account. All fields that are not arrays are converted to string. Fields that are in $meta_data_fields but for which no data is provided are initialized to an empty string.

Parameters

array $meta_data

The meta-data to store in this bibentry

get()

get(string  $field) : mixed

Get the value of a given field

Parameters

string $field

The key of the field to get.

Returns

mixed —

The string or array stored in the field.

get_surnames()

get_surnames() : string

Oxford comma separated list of all author and editor surnames.

Returns

string —

Oxford comma separated list of all author surnames.

get_formated_authors()

get_formated_authors() : string

Formated author and editor list

Editors are indicated with the string Editor: or Editors: before their names

Returns

string —

Oxford comma separated list of all authors and editors.

get_formated_html()

get_formated_html(  $doi_url_prefix,   $arxiv_url_abs_prefix) : string

HTML representation of the bibentry.

Parameters

$doi_url_prefix

Prefix to use for DOI links.

$arxiv_url_abs_prefix

Prefix to use for arXiv links.

Returns

string —

HTHL representation of the bibentry.

get_cite_as_text()

get_cite_as_text() : string

How to cite this bibentry.

Returns

string —

Text describing how to cite this bibentry.

merge()

merge(\O3PO_Bibentry  $bibitem1, \O3PO_Bibentry  $bibitem2) : \O3PO_Bibentry

Merge two bibentries.

Bibentries are merged field wise, in case of collisions $bibitem1 takes preference over $bibitem2.

Parameters

\O3PO_Bibentry $bibitem1

First bibentry to merge.

\O3PO_Bibentry $bibitem2

First bibentry to merge.

Returns

\O3PO_Bibentry

Merged bibentry.

match()

match(\O3PO_Bibentry  $bibitem1, \O3PO_Bibentry  $bibitem2) : boolean

Compare two bibentries.

Parameters

\O3PO_Bibentry $bibitem1

First bibentry to match.

\O3PO_Bibentry $bibitem2

First bibentry to match.

Returns

boolean —

True if bibentries are considered similar enough to probably represent the same bibliographic item, false otherwise.

merge_bibitem_arrays()

merge_bibitem_arrays(array  $array1, array  $array2, boolean  $remove_dulicates = true) : array

Merge two arrays of bibentries.

Merges $array2 into $array1. The content of the entries in $array1 takes preference over those in $array2, entries in $array2 that were not merged are appended at the end. Array keys in $array1 are preserved.

If $remove_dulicates is true all duplicates are removed from the final array by merging them into the first matching entry. Non-removed array keys are preserved.

Parameters

array $array1

First array of bibtentries.

array $array2

Second array of bibtentries.

boolean $remove_dulicates

Whether to remove duplicates.

Returns

array —

Merged array of bibentries.

remove_duplicates()

remove_duplicates(array  $array, boolean  $merge = false) 

Remove duplicates from an array of bibentries.

Duplicates are identified by comparing pairs with the help of match().

Parameters

array $array

Array of bibentries from which duplicates are to be removed.

boolean $merge

Whether to merge duplicates or simply discard them.