Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOUN-1370: add kafka event notification for roomEntry changes #12595

Open
wants to merge 4 commits into
base: Tucana-20.8.0
Choose a base branch
from

Conversation

Amirhalfon1
Copy link
Contributor

add kafka event notification template for roomEntry changes
raise event also if it doesn't require any permission

add kafka event notification for roomEntry changes
raise event also if it doesn't require any permission
@@ -114,7 +114,7 @@ public function dispatch(kScope $scope)
}

$requiredPermissions = explode(",", $this->getRequiresPermissions());
if(count($requiredPermissions))
if(count(array_filter($requiredPermissions)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the purpose is to remove all empty values that return true on the empty() function please state the function when calling array_filter. To avoid case where this logic will change in the future.

From PHP doc:
callback
The callback function to use

If no callback is supplied, all empty entries of array will be removed. See empty() for how PHP defines empty in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It isn't possible to pass "empty" to "array_filter" as "empty" is not a function but a language construct
I think I'll use "strlen" which doing the job in our case (the case when $this->getRequiresPermissions() returns null and explode returns array of empty string).
Is it sounds ok for you?

remove un-needed print_r
change "@TOPIC_NAME@" to "entry"
remove "template" from filename in script
use "strlen" for "array_filter" instead of default filter callback
@Amirhalfon1 Amirhalfon1 changed the base branch from Tucana-20.7.0 to Tucana-20.8.0 March 12, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants