source/Spiral/ORM/Helpers/RelationOptions.php
protected function calculateOptions(array $userOptions): array
    {
        foreach ($this->template as $property => $pattern) {
            if (isset($userOptions[$property])) {
                //Specified by user
                continue;
            }

            if (!is_string($pattern)) {
                //Some options are actually array of options
                $userOptions[$property] = $pattern;
                continue;
            }

            //Let's create option value using default proposer values
            $userOptions[$property] = \Spiral\interpolate(
                $pattern,
                $this->proposedOptions($userOptions)
            );
        }

        return $userOptions;
    }
protected function calculateOptions(array $userOptions): array
    {
        foreach ($this->template as $property => $pattern) {
            if (isset($userOptions[$property])) {
                //Specified by user
                continue;
            }

            if (!is_string($pattern)) {
                //Some options are actually array of options
                $userOptions[$property] = $pattern;
                continue;
            }

            //Let's create option value using default proposer values
            $userOptions[$property] = \Spiral\interpolate(
                $pattern,
                $this->proposedOptions($userOptions)
            );
        }

        return $userOptions;
    }
protected function calculateOptions ( array $ userOptions ) : array { foreach ( $ this -> template as $ property => $ pattern ) { if ( isset ( $ userOptions [ $ property ] ) ) { //Specified by user continue ; } if ( ! is_string ( $ pattern ) ) { //Some options are actually array of options $ userOptions [ $ property ] = $ pattern ; continue ; } //Let's create option value using default proposer values $ userOptions [ $ property ] = \ Spiral \ interpolate ( $ pattern , $ this -> proposedOptions ( $ userOptions ) ) ; } return $ userOptions ; }
Calculate options based on given template

@param array $userOptions Options provided by user.

@return array Calculated options.
Calculate options based on given template