@@ 345-364 (lines=20) @@ | ||
342 | * @return array|bool |
|
343 | * @throws \EE_Error |
|
344 | */ |
|
345 | public function get_questions_in_groups($QSG_IDs = '') |
|
346 | { |
|
347 | if (empty($QSG_IDs)) { |
|
348 | EE_Error::add_error( |
|
349 | esc_html__('An error occurred. No Question Group IDs were received.', 'event_espresso'), |
|
350 | __FILE__, __FUNCTION__, __LINE__ |
|
351 | ); |
|
352 | return false; |
|
353 | } |
|
354 | return EE_Registry::instance()->load_model('Question')->get_all( |
|
355 | array( |
|
356 | array( |
|
357 | 'Question_Group.QSG_ID' => array('IN', $QSG_IDs), |
|
358 | 'QST_deleted' => false, |
|
359 | 'QST_admin_only' => is_admin(), |
|
360 | ), |
|
361 | 'order_by' => 'QST_order', |
|
362 | ) |
|
363 | ); |
|
364 | } |
|
365 | ||
366 | ||
367 | ||
@@ 375-393 (lines=19) @@ | ||
372 | * @return array|bool |
|
373 | * @throws \EE_Error |
|
374 | */ |
|
375 | public function get_options_for_question($QST_IDs) |
|
376 | { |
|
377 | if (empty($QST_IDs)) { |
|
378 | EE_Error::add_error( |
|
379 | esc_html__('An error occurred. No Question IDs were received.', 'event_espresso'), |
|
380 | __FILE__, __FUNCTION__, __LINE__ |
|
381 | ); |
|
382 | return false; |
|
383 | } |
|
384 | return EE_Registry::instance()->load_model('Question_Option')->get_all( |
|
385 | array( |
|
386 | array( |
|
387 | 'Question.QST_ID' => array('IN', $QST_IDs), |
|
388 | 'QSO_deleted' => false, |
|
389 | ), |
|
390 | 'order_by' => 'QSO_ID', |
|
391 | ) |
|
392 | ); |
|
393 | } |
|
394 | ||
395 | ||
396 |