Code Duplication    Length = 12-14 lines in 2 locations

core/db_models/EEM_Event.model.php 1 location

@@ 59-70 (lines=12) @@
56
     * @return EEM_Event
57
     * @throws \EE_Error
58
     */
59
    public static function instance($timezone = null)
60
    {
61
        // check if instance of EEM_Event already exists
62
        if (! self::$_instance instanceof EEM_Event) {
63
            // instantiate Espresso_model
64
            self::$_instance = new self($timezone);
65
        }
66
        //we might have a timezone set, let set_timezone decide what to do with it
67
        self::$_instance->set_timezone($timezone);
68
        // EEM_Event object
69
        return self::$_instance;
70
    }
71
72
73

core/db_models/EEM_Base.model.php 1 location

@@ 710-723 (lines=14) @@
707
     *                         timezone in the 'timezone_string' wp option)
708
     * @return static (as in the concrete child class)
709
     */
710
    public static function instance($timezone = null)
711
    {
712
        // check if instance of Espresso_model already exists
713
        if (! static::$_instance instanceof static) {
714
            // instantiate Espresso_model
715
            static::$_instance = new static($timezone);
716
        }
717
        //we might have a timezone set, let set_timezone decide what to do with it
718
        static::$_instance->set_timezone($timezone);
719
        // Espresso_model object
720
        return static::$_instance;
721
    }
722
723
724
725
    /**
726
     * resets the model and returns it