Show the action() method please.
I've said it before and I get the idea that I'm yelling at the storm, but you're making your life much more complicated and harder with the DB abstraction you are creating.
array_intersect will tell you the items that were present in both arrays. All you're doing now is ensuring that the array it returns is not empty - it has at least one of the two roles. If you want to require both roles then you can (a) use array_diff or (b) continue with array_intersect but count the number of shared roles it found.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.