+
Skip to content

Conversation

tbialcz
Copy link
Contributor

@tbialcz tbialcz commented Apr 3, 2025

🎫 Issue IBX-9060

Description:

  • Introduced an optional $query parameter to getNotificationCount, loadNotifications, and related methods to enable filtering by notification type or data.
  • Adjusted query logic to apply filtering when $query is provided.
  • Updated related tests to cover the new filtering behavior.

@tbialcz tbialcz force-pushed the ibx_9060-notification-filtering branch 2 times, most recently from 5a21d61 to 3b8e815 Compare April 10, 2025 06:35
@tbialcz tbialcz force-pushed the ibx_9060-notification-filtering branch from 3b8e815 to 8bd2a39 Compare April 10, 2025 07:03
@adamwojs
Copy link
Member

In order to be consistent and avoid leaking implementation details, we need to approach problem differently.

Introduce Ibexa\Contracts\Core\Repository\NotificationService::findNotifications method:

interface NotificationService
{
    # ...
    public function findNotifications(?NotificationQuery $query = null): NotificationList;
}

Ibexa\Contracts\Core\Repository\Values\Notification\NotificationQuery which will hold pagination details, criteria and potentially in the future sort clauses or aggregations.

You will also need to introduce criteria classes for type, status, creation date alongside with logical operator: and, or, not.

Feel free to reach out to me if you have any questions 😉

@tbialcz tbialcz force-pushed the ibx_9060-notification-filtering branch 4 times, most recently from 6961c45 to d3df305 Compare May 8, 2025 09:16
@tbialcz tbialcz force-pushed the ibx_9060-notification-filtering branch from d3df305 to b5a96d8 Compare May 8, 2025 09:37
@tbialcz tbialcz requested a review from adamwojs May 20, 2025 11:53
…ifications` and `findNotifications`, updated related tests and handlers
Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API-wise it looks okay, however implementation of criteria dispatching needs some improvements (see the diff comment) :-)

@tbialcz tbialcz requested a review from alongosz June 10, 2025 11:52
…updated NotificationQuery, Gateway, tests and services
@tbialcz tbialcz force-pushed the ibx_9060-notification-filtering branch from 156ffd1 to 626debe Compare June 10, 2025 12:02
tbialcz added 3 commits June 10, 2025 14:49
…e`, updated handlers, NotificationQuery, and Gateway to align with new interface structure
…e`, updated handlers, NotificationQuery, and Gateway to align with new interface structure
@tbialcz tbialcz requested a review from adamwojs June 20, 2025 06:18
…ation and added getters/setters for criteria properties
@tbialcz tbialcz requested a review from Steveb-p June 23, 2025 06:20
…tor_to_array` in DoctrineDatabase Gateway
@tbialcz tbialcz force-pushed the ibx_9060-notification-filtering branch from bcdf9e9 to 8b26279 Compare June 23, 2025 08:30
Copy link

@adamwojs adamwojs merged commit 07187f8 into 4.6 Jun 24, 2025
24 checks passed
@adamwojs adamwojs deleted the ibx_9060-notification-filtering branch June 24, 2025 06:46
-
message: '#^Method Ibexa\\Core\\Persistence\\Legacy\\Notification\\Gateway\:\:loadUserNotifications\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
message: '#^Method Ibexa\\Core\\Persistence\\Legacy\\Notification\\Gateway\\DoctrineDatabase\:\:__construct\(\) has parameter \$criterionHandlers with generic interface Ibexa\\Contracts\\Core\\Repository\\Values\\Notification\\CriterionHandlerInterface but does not specify its types\: T$#'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbialcz I'm coming a bit late to the party, but the issues in new code need to be resolved instead of being added to the baseline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载