/** * There really isn't any concept of 'parent' method. An ExtensibleObject * instance contains an ordered array of extension classes, which provides * the method implementations for the instance to use. Suppose that an * ExtensibleObject has two extension, and both have the same methods.The * last extension appears to 'override' the first extension. So, instead of calling * a 'parent' method, we're actually just calling an extension that was added sooner than * the one that is providing the current method implementation. */ function call_parent($method) { $retval = NULL; // To simulate a 'parent' call, we remove the current mixin providing the // implementation. $klass = $this->object->get_mixin_providing($method); // Perform the routine described above... $this->object->disable_mixin_for($method, $klass); // Get the method map cache $orig_method_map = $this->object->_method_map_cache; $this->object->_method_map_cache = (array) C_Pope_Cache::get(array($this->object->context, $this->object->_mixin_priorities, $this->object->_disabled_map), $this->object->_method_map_cache); // Call anchor $args = func_get_args(); // Remove $method parameter array_shift($args); // Execute the method $retval = $this->object->call_method($method, $args); // Cache the method map for this configuration of mixins C_Pope_Cache::set(array($this->object->context, $this->object->_mixin_priorities, $this->object->_disabled_map), $this->object->_method_map_cache); // Re-enable mixins; // $this->object->add_mixin($klass); $this->object->enable_mixin_for($method, $klass); // Restore the original method map $this->object->_method_map_cache = $orig_method_map; return $retval; }