UserList
extends AbstractHelper
in package
List view helper
Tags
Table of Contents
- $favoritesService : FavoritesService
- $mode : string
- $userListService : UserListServiceInterface
- __construct() : mixed
- Constructor
- getMode() : string
- Get mode
- getUserListsAndCountsByUser() : array<string|int, mixed>
- Get lists with counts for the provided user.
- lastUsed() : mixed
- Retrieve the ID of the last list that was accessed, if any.
- userCanEditList() : bool
- Is the provided user allowed to edit the provided list?
Properties
$favoritesService
protected
FavoritesService
$favoritesService
$mode
protected
string
$mode
= 'enabled'
$userListService
protected
UserListServiceInterface
$userListService
Methods
__construct()
Constructor
public
__construct(FavoritesService $favoritesService, UserListServiceInterface $userListService[, string $mode = 'enabled' ]) : mixed
Parameters
- $favoritesService : FavoritesService
-
Favorites service
- $userListService : UserListServiceInterface
-
List database service
- $mode : string = 'enabled'
-
List mode (enabled or disabled)
Return values
mixed —getMode()
Get mode
public
getMode() : string
Return values
string —getUserListsAndCountsByUser()
Get lists with counts for the provided user.
public
getUserListsAndCountsByUser(UserEntityInterface $user) : array<string|int, mixed>
Parameters
- $user : UserEntityInterface
-
User owning lists
Return values
array<string|int, mixed> —lastUsed()
Retrieve the ID of the last list that was accessed, if any.
public
lastUsed() : mixed
Return values
mixed —User_list ID (if set) or null (if not available).
userCanEditList()
Is the provided user allowed to edit the provided list?
public
userCanEditList(UserEntityInterface|null $user, UserListEntityInterface $list) : bool
Parameters
- $user : UserEntityInterface|null
-
Logged-in user (null if none)
- $list : UserListEntityInterface
-
List to check