Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
queue: Add Filtering To Queues
This adds the ability to use Qs instead of Queue Criteria to better filter Queues. This updates class Queue and adds two new functions `filter()` and `getFilters()`. `filter()` simply adds the Q(s) to the new `filters` property for later access. `getFilters()` simply returns all of the queue filters (if any). In addition, this updates the `AdhocSearch::load()` method to detect if the Queue's Config is an instanceof Q and if so we filter the queue by that Q else we will use the Queue Criteria (if any). Currently we can't search for tickets with the User's email address equal to `firstname.lastname@example.org` **OR** Collaborator’s email address equal to `email@example.com` as Queue Criteria is only seen as **AND** statements. The queue criteria for this would look like: ``` array( array('user__emails__address', 'equal', $user->getEmail()->email), array('thread__collaborators__user__emails__address', 'equal', $user->getEmail()->email), ) ``` With the new filter methods we could actually find those tickets with a Q like: ``` Q::any([ 'user__emails__address' => $user->getDefaultEmailAddress(), 'thread__collaborators__user__emails__address' => $user->getDefaultEmailAddress(), ]) ```
- Loading branch information
Showing with 26 additions and 7 deletions.