Code Duplication    Length = 5-6 lines in 2 locations

caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php 1 location

@@ 528-532 (lines=5) @@
525
            );
526
            // if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly,
527
            // which means in turn that the prices will become new prices as well.
528
            if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
529
                $TKT_values['TKT_ID'] = 0;
530
                $TKT_values['TKT_is_default'] = 0;
531
                $update_prices = true;
532
            }
533
            // if we have a TKT_ID then we need to get that existing TKT_obj and update it
534
            // we actually do our saves ahead of doing any add_relations to
535
            // because its entirely possible that this ticket wasn't removed or added to any datetime in the session

admin_pages/events/Events_Admin_Page.core.php 1 location

@@ 1259-1264 (lines=6) @@
1256
                'TKT_price'       => $ticket_price,
1257
            );
1258
            // if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
1259
            if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
1260
                $TKT_values['TKT_ID'] = 0;
1261
                $TKT_values['TKT_is_default'] = 0;
1262
                $TKT_values['TKT_price'] = $ticket_price;
1263
                $update_prices = true;
1264
            }
1265
            // if we have a TKT_ID then we need to get that existing TKT_obj and update it
1266
            // we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1267
            // keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.