src/Model/AssociationsAwareTrait.php
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);
        }
    }
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);
        }
    }
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 ) ; } }
Set associations from "relation" type Modules.

@param string $module Module name
@param mixed[] $fields Module fields
@return void
Set associations from relation type Modules .