public function resolve($nameSchema, $contentType, array $fieldMap, array $languageCodes)
    {
        list($filteredNameSchema, $groupLookupTable) = $this->filterNameSchema($nameSchema);
        $tokens = $this->extractTokens($filteredNameSchema);
        $schemaIdentifiers = $this->getIdentifiers($nameSchema);

        $names = array();

        foreach ($languageCodes as $languageCode) {
            // Fetch titles for language code
            $titles = $this->getFieldTitles($schemaIdentifiers, $contentType, $fieldMap, $languageCode);
            $name = $filteredNameSchema;

            // Replace tokens with real values
            foreach ($tokens as $token) {
                $string = $this->resolveToken($token, $titles, $groupLookupTable);
                $name = str_replace($token, $string, $name);
            }

            // Make sure length is not longer then $limit unless it's 0
            if ($this->settings['limit'] && mb_strlen($name) > $this->settings['limit']) {
                $name = rtrim(mb_substr($name, 0, $this->settings['limit'] - strlen($this->settings['sequence']))) . $this->settings['sequence'];
            }

            $names[$languageCode] = $name;
        }

        return $names;
    }
public function resolve($nameSchema, $contentType, array $fieldMap, array $languageCodes)
    {
        list($filteredNameSchema, $groupLookupTable) = $this->filterNameSchema($nameSchema);
        $tokens = $this->extractTokens($filteredNameSchema);
        $schemaIdentifiers = $this->getIdentifiers($nameSchema);

        $names = array();

        foreach ($languageCodes as $languageCode) {
            // Fetch titles for language code
            $titles = $this->getFieldTitles($schemaIdentifiers, $contentType, $fieldMap, $languageCode);
            $name = $filteredNameSchema;

            // Replace tokens with real values
            foreach ($tokens as $token) {
                $string = $this->resolveToken($token, $titles, $groupLookupTable);
                $name = str_replace($token, $string, $name);
            }

            // Make sure length is not longer then $limit unless it's 0
            if ($this->settings['limit'] && mb_strlen($name) > $this->settings['limit']) {
                $name = rtrim(mb_substr($name, 0, $this->settings['limit'] - strlen($this->settings['sequence']))) . $this->settings['sequence'];
            }

            $names[$languageCode] = $name;
        }

        return $names;
    }
public function resolve ( $ nameSchema , $ contentType , array $ fieldMap , array $ languageCodes ) { list ( $ filteredNameSchema , $ groupLookupTable ) = $ this -> filterNameSchema ( $ nameSchema ) ; $ tokens = $ this -> extractTokens ( $ filteredNameSchema ) ; $ schemaIdentifiers = $ this -> getIdentifiers ( $ nameSchema ) ; $ names = array ( ) ; foreach ( $ languageCodes as $ languageCode ) { // Fetch titles for language code $ titles = $ this -> getFieldTitles ( $ schemaIdentifiers , $ contentType , $ fieldMap , $ languageCode ) ; $ name = $ filteredNameSchema ; // Replace tokens with real values foreach ( $ tokens as $ token ) { $ string = $ this -> resolveToken ( $ token , $ titles , $ groupLookupTable ) ; $ name = str_replace ( $ token , $ string , $ name ) ; } // Make sure length is not longer then $limit unless it's 0 if ( $ this -> settings [ 'limit' ] && mb_strlen ( $ name ) > $ this -> settings [ 'limit' ] ) { $ name = rtrim ( mb_substr ( $ name , 0 , $ this -> settings [ 'limit' ] - strlen ( $ this -> settings [ 'sequence' ] ) ) ) . $ this -> settings [ 'sequence' ] ; } $ names [ $ languageCode ] = $ name ; } return $ names ; }
Returns the real name for a content name pattern.

@param string $nameSchema
@param \eZ\Publish\SPI\Persistence\Content\Type|\eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType
@param array $fieldMap
@param array $languageCodes

@return string[]
Returns the real name for a content name pattern .