protected function _forward($type, $callable, $arguments = array(), $return = null)
    {
        settype($arguments, 'array');

        $results = array();
        $is_object = true;
        $is_boolean = true;
        foreach ($this as $object) {
            if ($type == 'method') {
                $value = call_object_method($object, $callable, $arguments);
            } else {
                if (empty($object->$callable)) {
                    continue;
                } else {
                    $value = $object->$callable;
                }
            }

            if (!is_object($value)) {
                $is_object = false;
            }

            if (!is_bool($value)) {
                $is_boolean = false;
            }

            $results[] = $value;
        }

        if (empty($results)) {
            if ($return == 'array') {
                return array();
            } elseif ($return == 'boolean') {
                return false;
            }
        }

        if ($is_object) {
            $set = new self();
            foreach ($results as $value) {
                $set->insert($value);
            }
            $results = $set;
        } elseif ($is_boolean) {
            $results = array_unique($results);
            $value = true;
            foreach ($results as $result) {
                $value = $value && $result;
            }

            $results = $value;
        }

        return $results;
    }
protected function _forward($type, $callable, $arguments = array(), $return = null)
    {
        settype($arguments, 'array');

        $results = array();
        $is_object = true;
        $is_boolean = true;
        foreach ($this as $object) {
            if ($type == 'method') {
                $value = call_object_method($object, $callable, $arguments);
            } else {
                if (empty($object->$callable)) {
                    continue;
                } else {
                    $value = $object->$callable;
                }
            }

            if (!is_object($value)) {
                $is_object = false;
            }

            if (!is_bool($value)) {
                $is_boolean = false;
            }

            $results[] = $value;
        }

        if (empty($results)) {
            if ($return == 'array') {
                return array();
            } elseif ($return == 'boolean') {
                return false;
            }
        }

        if ($is_object) {
            $set = new self();
            foreach ($results as $value) {
                $set->insert($value);
            }
            $results = $set;
        } elseif ($is_boolean) {
            $results = array_unique($results);
            $value = true;
            foreach ($results as $result) {
                $value = $value && $result;
            }

            $results = $value;
        }

        return $results;
    }
protected function _forward ( $ type , $ callable , $ arguments = array ( ) , $ return = null ) { settype ( $ arguments , 'array' ) ; $ results = array ( ) ; $ is_object = true ; $ is_boolean = true ; foreach ( $ this as $ object ) { if ( $ type == 'method' ) { $ value = call_object_method ( $ object , $ callable , $ arguments ) ; } else { if ( empty ( $ object -> $ callable ) ) { continue ; } else { $ value = $ object -> $ callable ; } } if ( ! is_object ( $ value ) ) { $ is_object = false ; } if ( ! is_bool ( $ value ) ) { $ is_boolean = false ; } $ results [ ] = $ value ; } if ( empty ( $ results ) ) { if ( $ return == 'array' ) { return array ( ) ; } elseif ( $ return == 'boolean' ) { return false ; } } if ( $ is_object ) { $ set = new self ( ) ; foreach ( $ results as $ value ) { $ set -> insert ( $ value ) ; } $ results = $ set ; } elseif ( $ is_boolean ) { $ results = array_unique ( $ results ) ; $ value = true ; foreach ( $ results as $ result ) { $ value = $ value && $ result ; } $ results = $ value ; } return $ results ; }
Forward a request to all the objects in the object set.

@return mixed
Forward a request to all the objects in the object set .