Code Duplication    Length = 4-21 lines in 3 locations

core/db_classes/EE_CPT_Base.class.php 1 location

@@ 148-151 (lines=4) @@
145
	 * @return EE_Base_Class the relation was removed from
146
	 */
147
	function remove_relation_to_term_taxonomy( $term_taxonomy ) {
148
		if ( !$term_taxonomy ) {
149
			EE_Error::add_error( sprintf( __( "No Term_Taxonomy provided which to remove from model object of type %s and id %d", "event_espresso" ), get_class( $this ), $this->ID() ), __FILE__, __FUNCTION__, __LINE__ );
150
			return NULL;
151
		}
152
		$term_taxonomy->set_count( $term_taxonomy->count() - 1 );
153
		$term_taxonomy->save();
154
		return $this->_remove_relation_to( $term_taxonomy, 'Term_Taxonomy' );

core/db_classes/EE_Registration.class.php 1 location

@@ 1449-1464 (lines=16) @@
1446
            $datetime = $this->get_latest_related_datetime();
1447
            $DTT_ID   = $datetime instanceof EE_Datetime ? $datetime->ID() : 0;
1448
            // verify the registration can checkin for the given DTT_ID
1449
        } elseif (! $this->can_checkin($DTT_ID, $verify)) {
1450
            EE_Error::add_error(
1451
                sprintf(
1452
                    esc_html__(
1453
                        'The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access',
1454
                        'event_espresso'
1455
                    ),
1456
                    $this->ID(),
1457
                    $DTT_ID
1458
                ),
1459
                __FILE__,
1460
                __FUNCTION__,
1461
                __LINE__
1462
            );
1463
            return false;
1464
        }
1465
        $status_paths = array(
1466
            EE_Checkin::status_checked_never => EE_Checkin::status_checked_in,
1467
            EE_Checkin::status_checked_in    => EE_Checkin::status_checked_out,

modules/single_page_checkout/reg_steps/attendee_information/EE_SPCO_Reg_Step_Attendee_Information.class.php 1 location

@@ 998-1018 (lines=21) @@
995
                                        $input_value = $primary_registrant[$form_input];
996
                                    }
997
                                    // now attempt to save the input data
998
                                    if (! $this->_save_registration_form_input(
999
                                        $registration,
1000
                                        $form_input,
1001
                                        $input_value
1002
                                    )
1003
                                    ) {
1004
                                        EE_Error::add_error(
1005
                                            sprintf(
1006
                                                esc_html__(
1007
                                                    'Unable to save registration form data for the form input: "%1$s" with the submitted value: "%2$s"',
1008
                                                    'event_espresso'
1009
                                                ),
1010
                                                $form_input,
1011
                                                $input_value
1012
                                            ),
1013
                                            __FILE__,
1014
                                            __FUNCTION__,
1015
                                            __LINE__
1016
                                        );
1017
                                        return false;
1018
                                    }
1019
                                }
1020
                            }
1021
                        }  // end of foreach ( $valid_data[ $reg_url_link ] as $form_section => $form_inputs )