Scandal
Well-known member
I have my own Entity for something.
This entity has the column allow_usergroups which have type SERIALIZED_ARRAY and includes some user group ids and [-1] for all.
Now I want to use the Finder to display some latest entries if the visitor belongs to that allow_usergroups array.
How I could achieve it?
I tried:
But with no result.
I have also a canView method on my Entity but it seems it has no connectivity with the finder.
I could fetch() some entity entries and then to use !$entry->canView() for unsetting, but it kills the limit() of the final list.
This entity has the column allow_usergroups which have type SERIALIZED_ARRAY and includes some user group ids and [-1] for all.
Now I want to use the Finder to display some latest entries if the visitor belongs to that allow_usergroups array.
How I could achieve it?
I tried:
Code:
$finder->whereOr([
['allow_usergroups', \XF::visitor()->user_group_id],
['allow_usergroups', \XF::visitor()->secondary_group_ids]
]);
I have also a canView method on my Entity but it seems it has no connectivity with the finder.
I could fetch() some entity entries and then to use !$entry->canView() for unsetting, but it kills the limit() of the final list.