CSCaraNotificationFilter
in package
Filter class that provides the ability to build a filter object for notifications
Tags
Table of Contents
- COMPARATOR_EQUAL = 1
- COMPARATOR_FIND_IN_SET = 4
- COMPARATOR_GREATER_THAN_OR_EQUAL = 2
- COMPARATOR_IN = 3
- COMPARATOR_SERVICE = 5
- COMPARATOR_USER_ACTION = 6
- FILTER_TYPE_AND = ' AND '
- __toString() : string
- Converts / returns the notification filter API objects to a filter string which can be used in SQL queries.
- addCategoryFilter() : bool
- Adds a filter for the field "Category".
- addExternalIdFilter() : bool
- Adds a filter for the field "ExternalID".
- addNotificationActionFilter() : bool
- Adds a filter for the notifications based on the user actions.
- addServiceFilter() : bool
- Adds a filter for the field "ServiceKey".
- addUserFilter() : bool
- Adds a filter for the field "UserId" from the NotificationUserAction join table.
- addValidFromFilter() : bool
- Adds a filter for the field "ValidFrom".
- addValidToFilter() : bool
- Adds a filter for the field "ValidTo".
- addVersionFilter() : bool
- Adds a filter for the field "Versions". Returns all notifications that contains the specified version, or notifications with an empty "Versions" field, meaning, they apply to all.
- createFilter() : CSCaraNotificationFilter
- Creates & returns the filter API object
- getFilterString() : string
- Converts / returns the notification filter API objects to a filter string which can be used in SQL queries
- getFilterType() : string
- Returns the current filter type
- getQueryString() : string
- Retrieves a complete query string to be executed based on the filter construction
Constants
COMPARATOR_EQUAL
public
mixed
COMPARATOR_EQUAL
= 1
Tags
COMPARATOR_FIND_IN_SET
public
mixed
COMPARATOR_FIND_IN_SET
= 4
Tags
COMPARATOR_GREATER_THAN_OR_EQUAL
public
mixed
COMPARATOR_GREATER_THAN_OR_EQUAL
= 2
Tags
COMPARATOR_IN
public
mixed
COMPARATOR_IN
= 3
Tags
COMPARATOR_SERVICE
public
mixed
COMPARATOR_SERVICE
= 5
Tags
COMPARATOR_USER_ACTION
public
mixed
COMPARATOR_USER_ACTION
= 6
Tags
FILTER_TYPE_AND
public
mixed
FILTER_TYPE_AND
= ' AND '
Tags
Methods
__toString()
Converts / returns the notification filter API objects to a filter string which can be used in SQL queries.
public
__toString() : string
Tags
Return values
string —with the filter string which can be used in SQL queries.
addCategoryFilter()
Adds a filter for the field "Category".
public
addCategoryFilter(array<string|int, mixed> $aValues[, bool $bIsNegativeFilter = false ]) : bool
Parameters
- $aValues : array<string|int, mixed>
-
An array with the category names to be filtered.
- $bIsNegativeFilter : bool = false
-
Whether it should be negative or positive search.
Tags
Return values
bool —Whether the filter has been added successfully
addExternalIdFilter()
Adds a filter for the field "ExternalID".
public
addExternalIdFilter(int $iExternalId[, bool $bIsNegativeFilter = false ]) : bool
Parameters
- $iExternalId : int
-
The external Id to filter for.
- $bIsNegativeFilter : bool = false
-
Whether it should be negative or positive search.
Tags
Return values
bool —Whether the filter has been added successfully.
addNotificationActionFilter()
Adds a filter for the notifications based on the user actions.
public
addNotificationActionFilter(int $iAction[, bool $bIsNegativeFilter = false ]) : bool
Allows to define, filter like: Retrieve all the 'dismissed' notifications
Parameters
- $iAction : int
-
The action id to search for (CSCaraConst:ACTION*).
- $bIsNegativeFilter : bool = false
-
Whether it should be negative or positive search.
Tags
Return values
bool —Whether the filter has been added successfully
addServiceFilter()
Adds a filter for the field "ServiceKey".
public
addServiceFilter(string $sService[, bool $bIsNegativeFilter = false ]) : bool
Parameters
- $sService : string
-
The service key to set the filter criteria.
- $bIsNegativeFilter : bool = false
-
Whether it should be negative or positive search.
Tags
Return values
bool —Whether the filter has been added successfully
addUserFilter()
Adds a filter for the field "UserId" from the NotificationUserAction join table.
public
addUserFilter(int $iUserId[, bool $bIsNegativeFilter = false ]) : bool
Parameters
- $iUserId : int
-
The user id to filter for.
- $bIsNegativeFilter : bool = false
-
Whether it should be negative or positive search.
Tags
Return values
bool —Whether the filter has been added successfully
addValidFromFilter()
Adds a filter for the field "ValidFrom".
public
addValidFromFilter(string $sDate[, bool $bIsNegativeFilter = false ]) : bool
Parameters
- $sDate : string
-
The date to set the filter criteria.
- $bIsNegativeFilter : bool = false
-
Whether it should be negative or positive search.
Tags
Return values
bool —Whether the filter has been added successfully.
addValidToFilter()
Adds a filter for the field "ValidTo".
public
addValidToFilter(string $sDate[, bool $bIsNegativeFilter = false ]) : bool
Parameters
- $sDate : string
-
The date to set the filter criteria.
- $bIsNegativeFilter : bool = false
-
Whether it should be negative or positive search.
Tags
Return values
bool —Whether the filter has been added successfully
addVersionFilter()
Adds a filter for the field "Versions". Returns all notifications that contains the specified version, or notifications with an empty "Versions" field, meaning, they apply to all.
public
addVersionFilter(string $sVersion[, bool $bIsNegativeFilter = false ]) : bool
Parameters
- $sVersion : string
-
The version to set the filter criteria.
- $bIsNegativeFilter : bool = false
-
Whether it should be negative or positive search.
Tags
Return values
bool —Whether the filter has been added successfully
createFilter()
Creates & returns the filter API object
public
static createFilter() : CSCaraNotificationFilter
Tags
Return values
CSCaraNotificationFilter —with the filter API object for the current API
getFilterString()
Converts / returns the notification filter API objects to a filter string which can be used in SQL queries
public
getFilterString() : string
Tags
Return values
string —with the filter string which can be used in SQL queries
getFilterType()
Returns the current filter type
public
getFilterType() : string
Tags
Return values
string —with the current filter type
getQueryString()
Retrieves a complete query string to be executed based on the filter construction
public
getQueryString() : string
