VuFind API Documentation

UserCardServiceInterface extends DbServiceInterface

Database service for UserCard.

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

activateLibraryCard()  : void
Activate a library card for the given username.
createEntity()  : UserCardEntityInterface
Create a UserCard entity object.
deleteLibraryCard()  : bool
Delete library card.
getAllRowsWithUsernames()  : array<string|int, UserCardEntityInterface>
Get user_card rows with catalog usernames set.
getInsecureRows()  : array<string|int, UserCardEntityInterface>
Get user_card rows with insecure catalog passwords.
getLibraryCards()  : array<string|int, UserCardEntityInterface>
Get all library cards associated with the user.
getOrCreateLibraryCard()  : UserCardEntityInterface
Get or create library card data.
persistEntity()  : void
Persist an entity.
persistLibraryCardData()  : UserCardEntityInterface
Persist the provided library card data, either by updating a specified card or by creating a new one (when $card is null). Also updates the primary user row when appropriate. Will throw an exception if a duplicate $username value is provided; there should only be one card row per username.
synchronizeUserLibraryCardData()  : bool
Verify that the user's current ILS settings exist in their library card data (if enabled) and are up to date. Designed to be called after updating the user row; will create or modify library card rows as needed.

Methods

getLibraryCards()

Get all library cards associated with the user.

public getLibraryCards(UserEntityInterface|int $userOrId[, int|null $id = null ][, string|null $catUsername = null ]) : array<string|int, UserCardEntityInterface>
Parameters
$userOrId : UserEntityInterface|int

User object or identifier

$id : int|null = null

Optional card ID filter

$catUsername : string|null = null

Optional catalog username filter

Return values
array<string|int, UserCardEntityInterface>

persistLibraryCardData()

Persist the provided library card data, either by updating a specified card or by creating a new one (when $card is null). Also updates the primary user row when appropriate. Will throw an exception if a duplicate $username value is provided; there should only be one card row per username.

public persistLibraryCardData(UserEntityInterface|int $userOrId, UserCardEntityInterface|int|null $cardOrId, string $cardName, string $username, string $password[, string $homeLib = '' ]) : UserCardEntityInterface

Returns the row that was added or updated.

Parameters
$userOrId : UserEntityInterface|int

User object or identifier

$cardOrId : UserCardEntityInterface|int|null

Card ID (null = create new)

$cardName : string

Card name

$username : string

Username

$password : string

Password

$homeLib : string = ''

Home Library

Tags
throws
LibraryCard
Return values
UserCardEntityInterface

synchronizeUserLibraryCardData()

Verify that the user's current ILS settings exist in their library card data (if enabled) and are up to date. Designed to be called after updating the user row; will create or modify library card rows as needed.

public synchronizeUserLibraryCardData(UserEntityInterface|int $userOrId) : bool
Parameters
$userOrId : UserEntityInterface|int

User object or identifier

Tags
throws
PasswordSecurity
Return values
bool

Search results