\O3PO_Author

A class to represent authors.

Summary

Methods
Properties
Constants
__construct()
get()
get_name()
get_name_bibtex()
get_surname()
get_affiliations_csv()
get_name_style()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$given_name
$surname
$name_style
$orcid
$url
$affiliations
$name_styles
N/A

Properties

$given_name

$given_name : 

Given name.

Type

$surname

$surname : 

Surname.

Type

$name_style

$name_style : 

Name style.

Can be one of "western", "eastern", "islensk", or "given-only".

Type

$orcid

$orcid : 

ORCID.

Type

$url

$url : 

Url.

Type

$affiliations

$affiliations : 

Array of affiliations.

An array of strings of the affiliations of the author.

Type

$name_styles

$name_styles : 

Array of valid name styles

Type

Methods

__construct()

__construct(string  $given_name, string  $surname, string  $name_style = 'western', string  $orcid = '', string  $url = '', array|string  $affiliations = array()) 

Construct an author

Construct an author object from given_name, surname, and further details. The $orcid is verified with a checksum test, and $affiliations can be given as both an array of strings or a single string of comma separated affiliations. Affiliations that contain a comma must be passed as an array containing a single string.

Parameters

string $given_name

The given name.

string $surname

The surname.

string $name_style

(optional) One of "western", "eastern", "islensk", ir "given-only".

string $orcid

(optional) The ORCID

string $url

(optional) The url, for example of the authors homepage.

array|string $affiliations

(optional) The affiliations of the author, either as an array of strings or a single string of comma separated affiliations.

get()

get(string  $field) : string

Get the content of any field of the the author.

Parameters

string $field

The field whose value to get.

Returns

string —

Value of the $field.

get_name()

get_name() : string

Get the full name of the author.

Returns

string —

The name of the author.

get_name_bibtex()

get_name_bibtex() : string

Get the name in bibtex format.

Returns

string —

The name of the author.

get_surname()

get_surname() : string

Get the surname of the author.

Returns

string —

The surname of the author.

get_affiliations_csv()

get_affiliations_csv() : string

Get a comma separated string of the author's affiliations.

TODO: Commas in affiliations are not escaped.

Returns

string —

Comma separated string of affiliations.

get_name_style()

get_name_style() : string

Get the name style.

Returns

string —

The name of the author.