private function setByTypeRelation(string $module, array $fields) : void
    {
        $moduleField = $this->getModuleRelatedField($fields);

        if (is_null($moduleField)) {
            return;
        }

        $selfrelated = $this->getSelfRelated($fields);
        if (!empty($selfrelated)) {
            $this->setByTypeSelfRelationField($module, $selfrelated);

            return;
        }

        foreach ($fields as $field) {
            $this->setByTypeRelationField($module, $field, $moduleField);
        }
    }