UserListService
extends AbstractDbService
in package
implements
DbTableAwareInterface, UserListServiceInterface
Uses
DbTableAwareTrait
Database service for UserList.
Tags
Interfaces, Classes, Traits and Enums
- DbTableAwareInterface
- Marker interface for classes that depend on the \VuFind\Db\Table\PluginManager
- UserListServiceInterface
- Database service interface for UserList.
Table of Contents
- $tableManager : PluginManager
- Database table plugin manager
- createEntity() : UserListEntityInterface
- Create a UserList entity object.
- deleteUserList() : void
- Delete a user list entity.
- getDbTable() : Gateway
- Get a database table object.
- getDbTableManager() : PluginManager
- Get the table plugin manager. Throw an exception if it is missing.
- getListsContainingRecord() : array<string|int, UserListEntityInterface>
- Get lists containing a specific record.
- getPublicLists() : array<string|int, UserListEntityInterface>
- Get public lists.
- getUserListById() : UserListEntityInterface
- Retrieve a list object.
- getUserListsAndCountsByUser() : array<string|int, mixed>
- Get lists belonging to the user and their count. Returns an array of arrays with list_entity and count keys.
- getUserListsByTagAndId() : array<string|int, UserListEntityInterface>
- Get lists associated with a particular tag and/or list of IDs. If IDs and tags are both provided, only the intersection of matches will be returned.
- getUserListsByUser() : array<string|int, UserListEntityInterface>
- Get list objects belonging to the specified user.
- persistEntity() : void
- Persist an entity.
- setDbTableManager() : void
- Set the table plugin manager.
Properties
$tableManager
Database table plugin manager
protected
PluginManager
$tableManager
Methods
createEntity()
Create a UserList entity object.
public
createEntity() : UserListEntityInterface
Return values
UserListEntityInterface —deleteUserList()
Delete a user list entity.
public
deleteUserList(UserListEntityInterface|int $listOrId) : void
Parameters
- $listOrId : UserListEntityInterface|int
-
List entity object or ID to delete
Return values
void —getDbTable()
Get a database table object.
public
getDbTable(string $table) : Gateway
Parameters
- $table : string
-
Table to load.
Return values
Gateway —getDbTableManager()
Get the table plugin manager. Throw an exception if it is missing.
public
getDbTableManager() : PluginManager
Tags
Return values
PluginManager —getListsContainingRecord()
Get lists containing a specific record.
public
getListsContainingRecord(string $recordId[, string $source = DEFAULT_SEARCH_BACKEND ][, UserEntityInterface|int|null $userOrId = null ]) : array<string|int, UserListEntityInterface>
Parameters
- $recordId : string
-
ID of record being checked.
- $source : string = DEFAULT_SEARCH_BACKEND
-
Source of record to look up
- $userOrId : UserEntityInterface|int|null = null
-
Optional user ID or entity object (to limit results to a particular user).
Return values
array<string|int, UserListEntityInterface> —getPublicLists()
Get public lists.
public
getPublicLists([array<string|int, mixed> $includeFilter = [] ][, array<string|int, mixed> $excludeFilter = [] ]) : array<string|int, UserListEntityInterface>
Parameters
- $includeFilter : array<string|int, mixed> = []
-
List of list ids or entities to include in result.
- $excludeFilter : array<string|int, mixed> = []
-
List of list ids or entities to exclude from result.
Return values
array<string|int, UserListEntityInterface> —getUserListById()
Retrieve a list object.
public
getUserListById(int $id) : UserListEntityInterface
Parameters
- $id : int
-
Numeric ID for existing list.
Tags
Return values
UserListEntityInterface —getUserListsAndCountsByUser()
Get lists belonging to the user and their count. Returns an array of arrays with list_entity and count keys.
public
getUserListsAndCountsByUser(UserEntityInterface|int $userOrId) : array<string|int, mixed>
Parameters
- $userOrId : UserEntityInterface|int
-
User entity object or ID
Tags
Return values
array<string|int, mixed> —getUserListsByTagAndId()
Get lists associated with a particular tag and/or list of IDs. If IDs and tags are both provided, only the intersection of matches will be returned.
public
getUserListsByTagAndId([string|array<string|int, string>|null $tag = null ][, int|array<string|int, int>|null $listId = null ][, bool $publicOnly = true ][, bool $andTags = true ][, bool $caseSensitiveTags = false ]) : array<string|int, UserListEntityInterface>
Parameters
- $tag : string|array<string|int, string>|null = null
-
Tag or tags to match (by text, not ID; null for all)
- $listId : int|array<string|int, int>|null = null
-
List ID or IDs to match (null for all)
- $publicOnly : bool = true
-
Whether to return only public lists
- $andTags : bool = true
-
Use AND operator when filtering by tag.
- $caseSensitiveTags : bool = false
-
Should we treat tags case-sensitively?
Return values
array<string|int, UserListEntityInterface> —getUserListsByUser()
Get list objects belonging to the specified user.
public
getUserListsByUser(UserEntityInterface|int $userOrId) : array<string|int, UserListEntityInterface>
Parameters
- $userOrId : UserEntityInterface|int
-
User entity object or ID
Return values
array<string|int, UserListEntityInterface> —persistEntity()
Persist an entity.
public
persistEntity(EntityInterface $entity) : void
Parameters
- $entity : EntityInterface
-
Entity to persist.
Return values
void —setDbTableManager()
Set the table plugin manager.
public
setDbTableManager(PluginManager $manager) : void
Parameters
- $manager : PluginManager
-
Plugin manager