src/OrderNameGenerator.php
public function getOrderName(Order $order): string
    {
        if (preg_match_all('/{{(.*)}}/U', $scheme = $this->getNameScheme(), $matches)) {
            foreach ($matches[1] as $index => $foundSnippet) {
                $foundSnippetName = trim($foundSnippet);
                $usedSnippet = $order->hasField($foundSnippetName)
                    ? $order->get($foundSnippetName)
                    : date($foundSnippetName);

                $scheme = str_replace($matches[0][$index], $usedSnippet, $scheme);
            }
        }

        return $scheme;
    }
public function getOrderName(Order $order): string
    {
        if (preg_match_all('/{{(.*)}}/U', $scheme = $this->getNameScheme(), $matches)) {
            foreach ($matches[1] as $index => $foundSnippet) {
                $foundSnippetName = trim($foundSnippet);
                $usedSnippet = $order->hasField($foundSnippetName)
                    ? $order->get($foundSnippetName)
                    : date($foundSnippetName);

                $scheme = str_replace($matches[0][$index], $usedSnippet, $scheme);
            }
        }

        return $scheme;
    }
public function getOrderName ( Order $ order ) : string { if ( preg_match_all ( '/{{(.*)}}/U' , $ scheme = $ this -> getNameScheme ( ) , $ matches ) ) { foreach ( $ matches [ 1 ] as $ index => $ foundSnippet ) { $ foundSnippetName = trim ( $ foundSnippet ) ; $ usedSnippet = $ order -> hasField ( $ foundSnippetName ) ? $ order -> get ( $ foundSnippetName ) : date ( $ foundSnippetName ) ; $ scheme = str_replace ( $ matches [ 0 ] [ $ index ] , $ usedSnippet , $ scheme ) ; } } return $ scheme ; }
Returns the name for the order.
@param Order $order
@return string
Returns the name for the order .