@@ 369-388 (lines=20) @@ | ||
366 | * @return array|bool |
|
367 | * @throws \EE_Error |
|
368 | */ |
|
369 | public function get_questions_in_groups($QSG_IDs = '') |
|
370 | { |
|
371 | if (empty($QSG_IDs)) { |
|
372 | EE_Error::add_error( |
|
373 | esc_html__('An error occurred. No Question Group IDs were received.', 'event_espresso'), |
|
374 | __FILE__, __FUNCTION__, __LINE__ |
|
375 | ); |
|
376 | return false; |
|
377 | } |
|
378 | return EE_Registry::instance()->load_model('Question')->get_all( |
|
379 | array( |
|
380 | array( |
|
381 | 'Question_Group.QSG_ID' => array('IN', $QSG_IDs), |
|
382 | 'QST_deleted' => false, |
|
383 | 'QST_admin_only' => is_admin(), |
|
384 | ), |
|
385 | 'order_by' => 'QST_order', |
|
386 | ) |
|
387 | ); |
|
388 | } |
|
389 | ||
390 | ||
391 | ||
@@ 399-417 (lines=19) @@ | ||
396 | * @return array|bool |
|
397 | * @throws \EE_Error |
|
398 | */ |
|
399 | public function get_options_for_question($QST_IDs) |
|
400 | { |
|
401 | if (empty($QST_IDs)) { |
|
402 | EE_Error::add_error( |
|
403 | esc_html__('An error occurred. No Question IDs were received.', 'event_espresso'), |
|
404 | __FILE__, __FUNCTION__, __LINE__ |
|
405 | ); |
|
406 | return false; |
|
407 | } |
|
408 | return EE_Registry::instance()->load_model('Question_Option')->get_all( |
|
409 | array( |
|
410 | array( |
|
411 | 'Question.QST_ID' => array('IN', $QST_IDs), |
|
412 | 'QSO_deleted' => false, |
|
413 | ), |
|
414 | 'order_by' => 'QSO_ID', |
|
415 | ) |
|
416 | ); |
|
417 | } |
|
418 | ||
419 | ||
420 |