VuFind API Documentation

UserCardService extends AbstractDbService
in package
implements DbServiceAwareInterface, DbTableAwareInterface, UserCardServiceInterface Uses DbServiceAwareTrait, DbTableAwareTrait

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

Interfaces, Classes, Traits and Enums

DbServiceAwareInterface
Marker interface for classes that depend on the \VuFind\Db\Service\PluginManager
DbTableAwareInterface
Marker interface for classes that depend on the \VuFind\Db\Table\PluginManager
UserCardServiceInterface
Database service for UserCard.

Table of Contents

$capabilities  : AccountCapabilities
$dbServiceManager  : PluginManager
Database service plugin manager
$ilsAuthenticator  : ILSAuthenticator
$tableManager  : PluginManager
Database table plugin manager
__construct()  : mixed
Constructor
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.
getDbService()  : T
Get a database service object.
getDbServiceManager()  : PluginManager
Get the service plugin manager. Throw an exception if it is missing.
getDbTable()  : Gateway
Get a database table object.
getDbTableManager()  : PluginManager
Get the table plugin manager. Throw an exception if it is missing.
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.
setDbServiceManager()  : void
Set the service plugin manager.
setDbTableManager()  : void
Set the table plugin manager.
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.

Properties

Methods

getDbService()

Get a database service object.

public getDbService(class-string<\VuFind\Db\Service\T> $name) : T
Parameters
$name : class-string<\VuFind\Db\Service\T>

Name of service to retrieve

Tags
template

T

Return values
T

getDbTable()

Get a database table object.

public getDbTable(string $table) : Gateway
Parameters
$table : string

Table to load.

Return values
Gateway

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 entity or 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