@@ 282-298 (lines=17) @@ | ||
279 | * @param string $QSG_IDs csv list of $QSG IDs |
|
280 | * @return array |
|
281 | */ |
|
282 | public function get_questions_in_groups( $QSG_IDs = '' ) { |
|
283 | ||
284 | if ( empty( $QSG_IDs )) { |
|
285 | EE_Error::add_error( __( 'An error occurred. No Question Group IDs were received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
286 | return FALSE; |
|
287 | } |
|
288 | ||
289 | return EE_Registry::instance()->load_model( 'Question' )->get_all( array( |
|
290 | array( |
|
291 | 'Question_Group.QSG_ID' => array( 'IN', $QSG_IDs ), |
|
292 | 'QST_deleted' => FALSE, |
|
293 | 'QST_admin_only' => is_admin() |
|
294 | ), |
|
295 | 'order_by' => 'QST_order' |
|
296 | )); |
|
297 | ||
298 | } |
|
299 | ||
300 | ||
301 | ||
@@ 313-328 (lines=16) @@ | ||
310 | * @param string $QST_IDs csv list of $QST IDs |
|
311 | * @return array |
|
312 | */ |
|
313 | public function get_options_for_question( $QST_IDs ) { |
|
314 | ||
315 | if ( empty( $QST_IDs )) { |
|
316 | EE_Error::add_error( __( 'An error occurred. No Question IDs were received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
317 | return FALSE; |
|
318 | } |
|
319 | ||
320 | return EE_Registry::instance()->load_model( 'Question_Option' )->get_all( array( |
|
321 | array( |
|
322 | 'Question.QST_ID' => array( 'IN', $QST_IDs ), |
|
323 | 'QSO_deleted' => FALSE |
|
324 | ), |
|
325 | 'order_by' => 'QSO_ID' |
|
326 | )); |
|
327 | ||
328 | } |
|
329 | ||
330 | ||
331 |