1 | <?php use EventEspresso\core\interfaces\ResettableInterface; |
||
26 | abstract class EED_Module extends EE_Configurable implements ResettableInterface { |
||
27 | |||
28 | /** |
||
29 | * instance of the EED_Module object |
||
30 | * @access protected |
||
31 | * @var EED_Module $_instance |
||
32 | */ |
||
33 | protected static $_instance = NULL; |
||
34 | |||
35 | /** |
||
36 | * rendered output to be returned to WP |
||
37 | * @access protected |
||
38 | * @var string $output |
||
39 | */ |
||
40 | protected $output = ''; |
||
41 | |||
42 | /** |
||
43 | * the current active espresso template theme |
||
44 | * @access protected |
||
45 | * @var string $theme |
||
46 | */ |
||
47 | protected $theme = ''; |
||
48 | |||
49 | |||
50 | |||
51 | /** |
||
52 | * @return mixed |
||
53 | */ |
||
54 | public static function reset() { |
||
55 | static::$_instance = null; |
||
56 | } |
||
57 | |||
58 | |||
59 | |||
60 | /** |
||
61 | * set_hooks - for hooking into EE Core, other modules, etc |
||
62 | * |
||
63 | * @access public |
||
64 | * @return void |
||
65 | */ |
||
66 | public static function set_hooks() {} |
||
67 | |||
68 | /** |
||
69 | * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
||
70 | * |
||
71 | * @access public |
||
72 | * @return void |
||
73 | */ |
||
74 | public static function set_hooks_admin() {} |
||
75 | |||
76 | |||
77 | |||
78 | /** |
||
79 | * run - initial module setup |
||
80 | * this method is primarily used for activating resources in the EE_Front_Controller thru the use of filters |
||
81 | * |
||
82 | * @access public |
||
83 | * @var WP $WP |
||
84 | * @return void |
||
85 | */ |
||
86 | public abstract function run( $WP ); |
||
87 | |||
88 | |||
89 | |||
90 | /** |
||
91 | * class constructor - can ONLY be instantiated by EE_Front_Controller |
||
92 | * |
||
93 | * @override default exception handling |
||
94 | * @access public |
||
95 | * @return \EED_Module |
||
|
|||
96 | */ |
||
97 | final public function __construct() { |
||
102 | |||
103 | |||
104 | |||
105 | /** |
||
106 | * @param $module_name |
||
107 | * @return EED_Module |
||
108 | */ |
||
109 | protected static function get_instance( $module_name = '' ) { |
||
116 | |||
117 | |||
118 | |||
119 | /** |
||
120 | * module_name |
||
121 | * |
||
122 | * @access public |
||
123 | * @return string |
||
124 | */ |
||
125 | public function module_name() { |
||
128 | |||
129 | |||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | public function theme() { |
||
137 | |||
138 | |||
139 | |||
140 | } |
||
141 | // End of file EED_Module.module.php |
||
142 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.