Developers

List

Whenever you're dealing with a list in your template, you're actually working with a List object.

Properties

id

Type: int|null

ID of the list.

reference

Type: string|null

A unique identifier for this list, often used in sharing.

typeId

Type: int|null

The List Type ID.

userId

Type: int|null

If logged in, this will be the user ID of the owner for this list.

sessionId

Type: string|null

If a guest, this will contain the unique session ID used to identify this guest.

default

Type: bool|null

Whether this list is marked as the default list for users.

title

Type: string|null

The title of this list.

lastIp

Type: string|null

A record of the last known IP for the guest or user of this list.

Methods

getItems()

Returns: array

Returns an Item query.

getItem(element, params)

Returns: verbb\wishlist\elements\Item|null

Returns an Item object for the given element, and query params.

hasItem(item)

Whether the provided item is in this list.

getAddItemUrl(element, params)

Returns: string

Returns the URL to add an item to the list.

getToggleItemUrl(element, params)

Returns: string

Returns the URL to remove an item from the list.

getRemoveItemUrl(element, params)

Returns: string

Returns the URL to toggle an item in the list.