protected function _getMergeRule($element, &$affected = null, $rule = null)
    {
        if ($rule instanceof MergeRuleInterface) {
            $result = $rule($this, $element, $affected);

            if ($result !== false) {
                return $result;
            }
        }

        $name = $element->getName();
        if (isset($this->{$name})) {
            $affected = $this->{$name};
            return self::MERGE_REPLACE;
        }

        return self::MERGE_APPEND;
    }