slug = $slug; $this->class = $class; $this->enabled = $this->enabled_by_default = $enabled_by_default; $this->options = $options; if( ! empty( $options['enabled'] ) ) { $this->enabled = true; } } /** * Returns the actual instance * * @return MC4WP_Integration */ public function load() { if( ! $this->instance instanceof MC4WP_Integration ) { $this->instance = new $this->class( $this->slug, $this->options ); } return $this->instance; } /** * Tunnel everything to MC4WP_Integration class * * @param $name * * @return MC4WP_Integration */ public function __call( $name, $arguments ) { return call_user_func_array( array( $this->load(), $name ), $arguments ); } /** * @param $name * * @return string */ public function __get( $name ) { return $this->load()->$name; } /** * @return string */ public function __toString() { return $this->slug; } }