Common functions for creators

version 1
package wikindx4\core\creator
author Mark Grimshaw

 Methods

CREATOR class.

__construct() 

Does this creator already exist in the database?

checkExists(string $surname, string $firstname, string $initials, string $prefix) : int

Parameters

$surname

string

$firstname

string

$initials

string

$prefix

string

Returns

intcreator ID if exists, FALSE otherwise

Format initials prior to storing in database

formatInitials(string $raw) : string

Initials are stored unpunctuated and space-delimited. In the final result, they can only consist of A-Z (and UTF-8) and space characters

Parameters

$raw

string

Returns

string

Get creators from creators table.

grabAll(int $userBib, mixed $typeArray, mixed $metadata, boolean $group) : array

Parameters

$userBib

int

ID of user bibliography to use. Default is FALSE

$typeArray

mixed

array of resource types within which to select creators. Default is FALSE

$metadata

mixed

metadata type or metadata array ('quote', 'paraphrase' etc) -- gather only creators for resources which have metadata Default is FALSE

$group

boolean

group database creators together into the same person if TRUE. Default is FALSE

Returns

arrayof id => creator

Gather creators who are not group members

grabGroupAvailableMasters() : mixed

Returns

mixedFALSE|array of creators

Gather creators who are not group masters

grabGroupAvailableMembers(boolean $notExists) : mixed

Parameters

$notExists

boolean

Returns

mixedFALSE|array of creators

Gather creators who are group masters

grabGroupMasters() : mixed

Returns

mixedFALSE|array of creators

Gather creators who are group members

grabGroupMembers(int $masterId) : mixed

Parameters

$masterId

int

Returns

mixedFALSE|array of creators

Inserts a new creator in the database.

insert(array $v) : int

Requires write permissions.

Parameters

$v

array

Array of surname, firstname, initials, prefix

Returns

intInserted ID

Remove resource-less and collection-less creators

removeHanging() 

Make the creator select transfer arrows to transfer creators between select boxes with onclick

transferArrows() : array

Returns

array(toRightImage, toLeftImage)

Format names returned from database

formatNames(array $row, array $creators) 

Parameters

$row

array

$creators

array

Array reference to be written to

 Properties

 

$commonBib 
 

$config 
 

$db 
 

$errors 
 

$gatekeep 
 

$html 
 

$names 
 

$stmt