Code Duplication    Length = 11-13 lines in 2 locations

modules/single_page_checkout/inc/EE_Checkout.class.php 2 locations

@@ 1247-1259 (lines=13) @@
1244
    {
1245
1246
        // verify object
1247
        if ($registration instanceof EE_Registration) {
1248
            // update the entity mapper attendee
1249
            $this->_refresh_registration_attendee($registration);
1250
            // update the entity mapper answers for reg form questions
1251
            $this->_refresh_registration_answers($registration);
1252
            // make sure the cached registration is added to the model entity mapper
1253
            $registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration);
1254
        } else {
1255
            EE_Error::add_error(
1256
                __(
1257
                    'An invalid Registration object was discovered when attempting to update the model entity mapper.',
1258
                    'event_espresso'
1259
                ),
1260
                __FILE__,
1261
                __FUNCTION__,
1262
                __LINE__
@@ 1304-1314 (lines=11) @@
1301
        // now update the answers
1302
        foreach ($registration->answers() as $cache_key => $answer) {
1303
            // verify object
1304
            if ($answer instanceof EE_Answer) {
1305
                if ($answer->ID()) {
1306
                    // make sure the cached answer is added to the model entity mapper
1307
                    $answer->get_model()->refresh_entity_map_with($answer->ID(), $answer);
1308
                }
1309
            } else {
1310
                EE_Error::add_error(
1311
                    __(
1312
                        'An invalid Answer object was discovered when attempting to update the model entity mapper.',
1313
                        'event_espresso'
1314
                    ),
1315
                    __FILE__,
1316
                    __FUNCTION__,
1317
                    __LINE__