protected function enrichListParents()
    {
        if (empty($this->listParents)) {
            return;
        }

        // Mark for each list parents entry how the query params should be set up
        $queries        = [];
        $previousModel  = $this->getModelInformation()->modelClass();

        /** @var ListParentData[] $reversed */
        $reversed = array_reverse($this->listParents);

        foreach ($reversed as $index => $parent) {

            $nextParent = isset($reversed[ $index + 1 ]) ? $reversed[ $index + 1 ] : null;

            if ($previousModel != get_class($parent->model)) {
                $queries[] = null;
            } else {

                if ($nextParent) {
                    $queries[] = 'parent=' . $nextParent->relation . $this->getListParentSeparator() . $nextParent->key;
                } else {
                    $queries[] = 'parents=';
                }
            }

            $previousModel = get_class($parent->model);
        }

        $queries = array_values(array_reverse($queries));

        foreach ($queries as $index => $query) {
            $this->listParents[$index]->query = $query;
        }
    }