class ContributorObject in Bibliography Module 7.2
Contributor Match Object
A simple value object that contains the properties for a contributor
Hierarchy
- class \Nametools\MatchObject
- class \Analyzer\ContributorObject
Expanded class hierarchy of ContributorObject
File
- lib/
msrc-authortool/ src/ Analyzer/ ContributorObject.php, line 18
Namespace
AnalyzerView source
class ContributorObject extends MatchObject {
/**
* @var string
* First Name
*/
public $firstName;
/**
* @var string
* Last Name
*/
public $lastName;
/**
* @var string
* Middle Name
*/
public $middleName;
/**
* @var string
* First Initial
*/
public $firstInitial;
/**
* @var string
* Middle Initial
*/
public $middleInitial;
/**
* @var string
* Second Middle Initial
*/
public $secondMiddleInitial;
/**
* @var string
* Organization
*/
public $organization;
/**
* @var string
* Normalized suffixes (jr., sr. or whatever)
*/
public $suffix;
/**
* @var string
* Prefix for last name (von, van, van der, or whatever)
*/
public $lastNamePrefix;
/**
* @var string
* Original string
*/
public $originalString;
// --------------------------------------------------------------
/**
* Map a suffix
*
* @param string $suffix A common suffix (Jr., Sr. etc)
* @return string A normalized version of that suffix
*/
public function mapSuffix($suffix) {
//get the letters and numbers only
preg_match("/[a-z0-9]/i", $suffix, $matches);
$suffix = implode('', array_slice($matches, 1));
$suffixMap = $this
->getSuffixMap();
return isset($suffixMap[$suffix]) ? $suffixMap[$suffix] : false;
}
// --------------------------------------------------------------
/**
* Get an array of common suffixes
*
* @return array Keys are normalized suffixes, values are proper suffixes
*/
public function getSuffixMap() {
return array(
'2nd' => '2nd',
'3rd' => '3rd',
'phd' => 'Ph.D.',
'ms' => 'M.S.',
'ma' => 'M.A.',
'jr' => 'Jr.',
'sr' => 'Sr.',
'psyd' => 'Psy.D.',
'frcpi' => 'F.R.C.P.I.',
'2' => '2nd',
'II' => '2nd',
'III' => '3rd',
'IV' => '4th',
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContributorObject:: |
public | property | First Initial | |
ContributorObject:: |
public | property | First Name | |
ContributorObject:: |
public | property | Last Name | |
ContributorObject:: |
public | property | Prefix for last name (von, van, van der, or whatever) | |
ContributorObject:: |
public | property | Middle Initial | |
ContributorObject:: |
public | property | Middle Name | |
ContributorObject:: |
public | property | Organization | |
ContributorObject:: |
public | property | Original string | |
ContributorObject:: |
public | property | Second Middle Initial | |
ContributorObject:: |
public | property | Normalized suffixes (jr., sr. or whatever) | |
ContributorObject:: |
public | function | Get an array of common suffixes | |
ContributorObject:: |
public | function | Map a suffix | |
MatchObject:: |
public static | function | Factory method | |
MatchObject:: |
public | function | Set magic method prevents setting undefined variables | |
MatchObject:: |
public | function | To string magic method |