protected function removeDependedAliases($alias, $id)
    {
        foreach ($this->ids[$id] as $otherAlias) {
            if (isset($this->aliases[$otherAlias]) && $this->aliases[$otherAlias] === $alias) {
                unset($this->aliases[$otherAlias]);
                $aliases = &$this->ids[$id];
                unset($aliases[array_search($otherAlias, $aliases, true)]);
                if (!empty($aliases)) {
                    $this->removeDependedAliases($otherAlias, $id);
                } else {
                    unset($this->ids[$id]);
                }
            }
        }
    }