public function batchRun($is_hook, $method_name, array $params = NULL)
    {
        // Prevents annoying notices.
		if($params == NULL) {
			$params = array();
		}

        // We collect the results into an array.
        $results = array();
        if(!$this->modules) $this->modules = array();
        foreach($this->modules as $name => $module) {
            if(method_exists($module, $method_name)) {
                $result = call_user_func_array(array($module, $method_name), $params);
                if($is_hook) { // Hooks are pre-emptive if they return something.
                    if($result) {
                        return $result;
                    }
                } else { // Collecting
                    $results[$name] = $result;
                }
            }
		}

        return $is_hook? false : $results;
    }
public function batchRun($is_hook, $method_name, array $params = NULL)
    {
        // Prevents annoying notices.
		if($params == NULL) {
			$params = array();
		}

        // We collect the results into an array.
        $results = array();
        if(!$this->modules) $this->modules = array();
        foreach($this->modules as $name => $module) {
            if(method_exists($module, $method_name)) {
                $result = call_user_func_array(array($module, $method_name), $params);
                if($is_hook) { // Hooks are pre-emptive if they return something.
                    if($result) {
                        return $result;
                    }
                } else { // Collecting
                    $results[$name] = $result;
                }
            }
		}

        return $is_hook? false : $results;
    }
public function batchRun ( $ is_hook , $ method_name , array $ params = NULL ) { // Prevents annoying notices. if ( $ params == NULL ) { $ params = array ( ) ; } // We collect the results into an array. $ results = array ( ) ; if ( ! $ this -> modules ) $ this -> modules = array ( ) ; foreach ( $ this -> modules as $ name => $ module ) { if ( method_exists ( $ module , $ method_name ) ) { $ result = call_user_func_array ( array ( $ module , $ method_name ) , $ params ) ; if ( $ is_hook ) { // Hooks are pre-emptive if they return something. if ( $ result ) { return $ result ; } } else { // Collecting $ results [ $ name ] = $ result ; } } } return $ is_hook ? false : $ results ; }
Batch runs a method on all modules.
@param bool $is_hook specifies that this is a hook call.
@param string $method_name is the method to be used on all modules.
@param array $params is an array of parameters to pass to all methods.
Batch runs a method on all modules .