eZ\Publish\Core\Repository\Helper\NameSchemaService::getIdentifiers PHP Method

getIdentifiers() protected method

Returns all identifiers from all tokens in the name schema.
protected getIdentifiers ( string $schemaString ) : array
$schemaString string
return array
    protected function getIdentifiers($schemaString)
    {
        $allTokens = '#<(.*)>#U';
        $identifiers = '#\\W#';
        $tmpArray = array();
        preg_match_all($allTokens, $schemaString, $matches);
        foreach ($matches[1] as $match) {
            $tmpArray[] = preg_split($identifiers, $match, -1, PREG_SPLIT_NO_EMPTY);
        }
        $retArray = array();
        foreach ($tmpArray as $matchGroup) {
            if (is_array($matchGroup)) {
                foreach ($matchGroup as $item) {
                    $retArray[] = $item;
                }
            } else {
                $retArray[] = $matchGroup;
            }
        }
        return $retArray;
    }