Code Duplication    Length = 9-16 lines in 3 locations

modules/single_page_checkout/inc/EE_Checkout.class.php 1 location

@@ 643-651 (lines=9) @@
640
        ) {
641
            // set the start time for this reg step
642
            if (! $this->transaction->set_reg_step_initiated($reg_step->slug())) {
643
                if (WP_DEBUG) {
644
                    EE_Error::add_error(
645
                        sprintf(
646
                            __('The "%1$s" registration step was not initialized properly.', 'event_espresso'),
647
                            $reg_step->name()
648
                        ),
649
                        __FILE__,
650
                        __FUNCTION__,
651
                        __LINE__
652
                    );
653
                }
654
            }

core/db_models/EEM_Base.model.php 2 locations

@@ 6034-6043 (lines=10) @@
6031
     */
6032
    public function get_IDs($model_objects, $filter_out_empty_ids = false)
6033
    {
6034
        if (! $this->has_primary_key_field()) {
6035
            if (WP_DEBUG) {
6036
                EE_Error::add_error(
6037
                    __('Trying to get IDs from a model than has no primary key', 'event_espresso'),
6038
                    __FILE__,
6039
                    __FUNCTION__,
6040
                    __LINE__
6041
                );
6042
            }
6043
        }
6044
        $IDs = array();
6045
        foreach ($model_objects as $model_object) {
6046
            $id = $model_object->ID();
@@ 6047-6062 (lines=16) @@
6044
        $IDs = array();
6045
        foreach ($model_objects as $model_object) {
6046
            $id = $model_object->ID();
6047
            if (! $id) {
6048
                if ($filter_out_empty_ids) {
6049
                    continue;
6050
                }
6051
                if (WP_DEBUG) {
6052
                    EE_Error::add_error(
6053
                        __(
6054
                            'Called %1$s on a model object that has no ID and so probably hasn\'t been saved to the database',
6055
                            'event_espresso'
6056
                        ),
6057
                        __FILE__,
6058
                        __FUNCTION__,
6059
                        __LINE__
6060
                    );
6061
                }
6062
            }
6063
            $IDs[] = $id;
6064
        }
6065
        return $IDs;