@@ 660-673 (lines=14) @@ | ||
657 | * timezone in the 'timezone_string' wp option) |
|
658 | * @return static (as in the concrete child class) |
|
659 | */ |
|
660 | public static function instance($timezone = null) |
|
661 | { |
|
662 | // check if instance of Espresso_model already exists |
|
663 | if ( ! static::$_instance instanceof static) { |
|
664 | // instantiate Espresso_model |
|
665 | static::$_instance = new static($timezone); |
|
666 | } |
|
667 | //we might have a timezone set, let set_timezone decide what to do with it |
|
668 | static::$_instance->set_timezone($timezone); |
|
669 | // Espresso_model object |
|
670 | return static::$_instance; |
|
671 | } |
|
672 | ||
673 | ||
674 | ||
675 | /** |
|
676 | * resets the model and returns it |
@@ 60-71 (lines=12) @@ | ||
57 | * |
|
58 | * @return EEM_Event |
|
59 | */ |
|
60 | public static function instance($timezone = null) |
|
61 | { |
|
62 | ||
63 | // check if instance of EEM_Event already exists |
|
64 | if ( ! self::$_instance instanceof EEM_Event) { |
|
65 | // instantiate Espresso_model |
|
66 | self::$_instance = new self($timezone); |
|
67 | } |
|
68 | //we might have a timezone set, let set_timezone decide what to do with it |
|
69 | self::$_instance->set_timezone($timezone); |
|
70 | ||
71 | // EEM_Event object |
|
72 | return self::$_instance; |
|
73 | } |
|
74 |