Support

Home Forums Event Espresso Premium EE4 – Querying with EE Models – Tickets From events list

EE4 – Querying with EE Models – Tickets From events list

Posted: October 11, 2017 at 5:30 am


JacquesMivi

October 11, 2017 at 5:30 am

Hello,

I try to find the way in your documentation but without success. How can I have the list of tickets with an array_tickets_ids ? Can I dot that with your querying system ? Somethink like :

$arrayevtids = array( 10404, 10405 );
$tickets = EEM_Ticket::instance()->get_all(
array(
array(
‘EVT_ID’ => array(‘IN’, $arrayevtids),
),
)
);

I know I have to pass by the datetime, but I dont know how.

Maybe it can help you, and of course you should know it, but I really love the gravity documentaion.
https://docs.gravityforms.com/category/extending-gravity-forms/api/

It could save lot of questions, like this one.

Thanks a lot for your help,


Tony

  • Support Staff

October 11, 2017 at 1:17 pm

Hi there,

So you want to pull all the ticket from all of the ID’s you pass in the array? (Just confirming)

If you check your error logs you’ll likely see something like this:

PHP Fatal error: Uncaught EE_Error: There is no model named 'EVT_ID' related to EEM_Ticket. Query param type is 0 and original query param is EVT_ID...

Because tickets are related to datetimes, you need to use:

'Datetime.EVT_ID' => array('IN', $arrayevtids),

Which will then pull all tickets for events with ID 10404 & 10405.


JacquesMivi

October 12, 2017 at 2:47 am

Yes it was what I looking for.
Thanks a lot.


Tony

  • Support Staff

October 12, 2017 at 2:59 am

You’re most welcome.

The support post ‘EE4 – Querying with EE Models – Tickets From events list’ 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