@@ 66-77 (lines=12) @@ | ||
63 | * @return EEM_Event |
|
64 | * @throws \EE_Error |
|
65 | */ |
|
66 | public static function instance($timezone = null) |
|
67 | { |
|
68 | // check if instance of EEM_Event already exists |
|
69 | if (! self::$_instance instanceof EEM_Event) { |
|
70 | // instantiate Espresso_model |
|
71 | self::$_instance = new self($timezone); |
|
72 | } |
|
73 | //we might have a timezone set, let set_timezone decide what to do with it |
|
74 | self::$_instance->set_timezone($timezone); |
|
75 | // EEM_Event object |
|
76 | return self::$_instance; |
|
77 | } |
|
78 | ||
79 | ||
80 |
@@ 709-722 (lines=14) @@ | ||
706 | * timezone in the 'timezone_string' wp option) |
|
707 | * @return static (as in the concrete child class) |
|
708 | */ |
|
709 | public static function instance($timezone = null) |
|
710 | { |
|
711 | // check if instance of Espresso_model already exists |
|
712 | if (! static::$_instance instanceof static) { |
|
713 | // instantiate Espresso_model |
|
714 | static::$_instance = new static($timezone); |
|
715 | } |
|
716 | //we might have a timezone set, let set_timezone decide what to do with it |
|
717 | static::$_instance->set_timezone($timezone); |
|
718 | // Espresso_model object |
|
719 | return static::$_instance; |
|
720 | } |
|
721 | ||
722 | ||
723 | ||
724 | /** |
|
725 | * resets the model and returns it |