@@ 493-499 (lines=7) @@ | ||
490 | //now we need to get the question group relations and handle that |
|
491 | //first primary question groups |
|
492 | $orig_primary_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 1 ) ) ); |
|
493 | if ( !empty( $orig_primary_qgs ) ) { |
|
494 | foreach ( $orig_primary_qgs as $id => $obj ) { |
|
495 | if ( $obj instanceof EE_Question_Group ) { |
|
496 | $new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 1 ) ); |
|
497 | } |
|
498 | } |
|
499 | } |
|
500 | ||
501 | //next additional attendee question groups |
|
502 | $orig_additional_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 0 ) ) ); |
|
@@ 503-509 (lines=7) @@ | ||
500 | ||
501 | //next additional attendee question groups |
|
502 | $orig_additional_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 0 ) ) ); |
|
503 | if ( !empty( $orig_additional_qgs ) ) { |
|
504 | foreach ( $orig_additional_qgs as $id => $obj ) { |
|
505 | if ( $obj instanceof EE_Question_Group ) { |
|
506 | $new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 0 ) ); |
|
507 | } |
|
508 | } |
|
509 | } |
|
510 | ||
511 | //now save |
|
512 | $new_event->save(); |