Support

Home Forums Community Forum Filter events with multiple custom meta keys and value

Filter events with multiple custom meta keys and value

Posted: December 27, 2016 at 3:42 pm


behairy

December 27, 2016 at 3:42 pm

Hello,

I have two custom meta keys (type & genre). I’m using EE4 model querying
to filter events, but only one is being used and the other is ignored. After inspecting the SQL generated, it seems that EE_Base does not automatically generate a SELF-JOIN, which how such case should be handled. Is there any native way of doing this in EE4?

$events = EEM_Event::instance()->get_all(array(
array(
‘AND’ => array(
‘Post_Meta.meta_value*a’=>’genre’,
‘Post_Meta.meta_value*b’=>’genre1’,

),
‘AND’ => array(
‘Post_Meta.meta_key*c’=>’type’,
‘Post_Meta.meta_value*d’=>’type1’,

)

)));

The support post ‘Filter events with multiple custom meta keys and value’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso