Code Duplication    Length = 12-14 lines in 2 locations

core/db_models/EEM_Event.model.php 1 location

@@ 54-65 (lines=12) @@
51
	 * @param string $timezone
52
	 * @return EEM_Event
53
	 */
54
	public static function instance( $timezone = NULL ){
55
56
		// check if instance of EEM_Event already exists
57
		if ( ! self::$_instance instanceof EEM_Event ) {
58
			// instantiate Espresso_model
59
			self::$_instance = new self( $timezone );
60
		}
61
		//we might have a timezone set, let set_timezone decide what to do with it
62
		self::$_instance->set_timezone( $timezone );
63
		// EEM_Event object
64
		return self::$_instance;
65
	}
66
67
68
	/**

core/db_models/EEM_Base.model.php 1 location

@@ 594-607 (lines=14) @@
591
	 *		@param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).  Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
592
	 *		@return static (as in the concrete child class)
593
	 */
594
	public static function instance( $timezone = NULL ){
595
596
		// check if instance of Espresso_model already exists
597
		if ( ! static::$_instance instanceof static) {
598
			// instantiate Espresso_model
599
			static::$_instance = new static( $timezone );
600
		}
601
602
		//we might have a timezone set, let set_timezone decide what to do with it
603
		static::$_instance->set_timezone( $timezone );
604
605
		// Espresso_model object
606
		return static::$_instance;
607
	}
608
609
610