UserResource
extends Gateway
in package
implements
DbServiceAwareInterface
Uses
DbServiceAwareTrait
Table Definition for user_resource
Tags
Interfaces, Classes, Traits and Enums
- DbServiceAwareInterface
- Marker interface for classes that depend on the \VuFind\Db\Service\PluginManager
Table of Contents
- $dbServiceManager : PluginManager
- Database service plugin manager
- $tableManager : PluginManager
- Table manager
- __construct() : mixed
- Constructor
- beginTransaction() : void
- Begin a database transaction.
- commitTransaction() : void
- Commit a database transaction.
- createOrUpdateLink() : UserResource
- Create link if one does not exist; update notes if one does.
- createRow() : object
- Create a new row.
- deduplicate() : void
- Deduplicate rows (sometimes necessary after merging foreign key IDs).
- destroyLinks() : void
- Unlink rows for the specified resource. This will also automatically remove any tags associated with the relationship.
- getDbService() : T
- Get a database service object.
- getDbServiceManager() : PluginManager
- Get the service plugin manager. Throw an exception if it is missing.
- getDbTable() : Gateway
- Get access to another table.
- getDuplicates() : mixed
- Get a list of duplicate rows (this sometimes happens after merging IDs, for example after a Summon resource ID changes).
- getSavedData() : AbstractResultSet
- Get information saved in a user's favorites for a particular record.
- getStatistics() : array<string|int, mixed>
- Get statistics on use of lists.
- initializeFeatures() : void
- Initialize features
- rollBackTransaction() : void
- Roll back a database transaction.
- setDbServiceManager() : void
- Set the service plugin manager.
Properties
$dbServiceManager
Database service plugin manager
protected
PluginManager
$dbServiceManager
$tableManager
Table manager
protected
PluginManager
$tableManager
Methods
__construct()
Constructor
public
__construct(Adapter $adapter, PluginManager $tm, array<string|int, mixed> $cfg[, RowGateway $rowObj = null ][, string $table = 'user_resource' ]) : mixed
Parameters
- $adapter : Adapter
-
Database adapter
- $tm : PluginManager
-
Table manager
- $cfg : array<string|int, mixed>
-
Laminas configuration
- $rowObj : RowGateway = null
-
Row prototype object (null for default)
- $table : string = 'user_resource'
-
Name of database table to interface with
Return values
mixed —beginTransaction()
Begin a database transaction.
public
beginTransaction() : void
Tags
Return values
void —commitTransaction()
Commit a database transaction.
public
commitTransaction() : void
Tags
Return values
void —createOrUpdateLink()
Create link if one does not exist; update notes if one does.
public
createOrUpdateLink(string $resource_id, string $user_id, string $list_id[, string $notes = '' ]) : UserResource
Parameters
- $resource_id : string
-
ID of resource to link up
- $user_id : string
-
ID of user creating link
- $list_id : string
-
ID of list to link up
- $notes : string = ''
-
Notes to associate with link
Tags
Return values
UserResource —createRow()
Create a new row.
public
createRow() : object
Return values
object —deduplicate()
Deduplicate rows (sometimes necessary after merging foreign key IDs).
public
deduplicate() : void
Return values
void —destroyLinks()
Unlink rows for the specified resource. This will also automatically remove any tags associated with the relationship.
public
destroyLinks(string|array<string|int, mixed> $resource_id, string $user_id[, string $list_id = null ]) : void
Parameters
- $resource_id : string|array<string|int, mixed>
-
ID (or array of IDs) of resource(s) to unlink (null for ALL matching resources)
- $user_id : string
-
ID of user removing links
- $list_id : string = null
-
ID of list to unlink (null for ALL matching lists, with the destruction of all tags associated with the $resource_id value; true for ALL matching lists, but retaining any tags associated with the $resource_id independently of lists)
Tags
Return values
void —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
Return values
T —getDbServiceManager()
Get the service plugin manager. Throw an exception if it is missing.
public
getDbServiceManager() : PluginManager
Tags
Return values
PluginManager —getDbTable()
Get access to another table.
public
getDbTable(string $table) : Gateway
Parameters
- $table : string
-
Table name
Return values
Gateway —getDuplicates()
Get a list of duplicate rows (this sometimes happens after merging IDs, for example after a Summon resource ID changes).
public
getDuplicates() : mixed
Return values
mixed —getSavedData()
Get information saved in a user's favorites for a particular record.
public
getSavedData(string $resourceId[, string $source = DEFAULT_SEARCH_BACKEND ][, int $listId = null ][, int $userId = null ]) : AbstractResultSet
Parameters
- $resourceId : string
-
ID of record being checked.
- $source : string = DEFAULT_SEARCH_BACKEND
-
Source of record to look up
- $listId : int = null
-
Optional list ID (to limit results to a particular list).
- $userId : int = null
-
Optional user ID (to limit results to a particular user).
Return values
AbstractResultSet —getStatistics()
Get statistics on use of lists.
public
getStatistics() : array<string|int, mixed>
Return values
array<string|int, mixed> —initializeFeatures()
Initialize features
public
initializeFeatures(array<string|int, mixed> $cfg) : void
Parameters
- $cfg : array<string|int, mixed>
-
Laminas configuration
Return values
void —rollBackTransaction()
Roll back a database transaction.
public
rollBackTransaction() : void
Tags
Return values
void —setDbServiceManager()
Set the service plugin manager.
public
setDbServiceManager(PluginManager $manager) : void
Parameters
- $manager : PluginManager
-
Plugin manager