protected function getFieldTitles(array $schemaIdentifiers, $contentType, array $fieldMap, $languageCode)
    {
        $fieldTitles = array();

        foreach ($schemaIdentifiers as $fieldDefinitionIdentifier) {
            if (isset($fieldMap[$fieldDefinitionIdentifier][$languageCode])) {
                if ($contentType instanceof SPIContentType) {
                    $fieldDefinition = null;
                    foreach ($contentType->fieldDefinitions as $spiFieldDefinition) {
                        if ($spiFieldDefinition->identifier === $fieldDefinitionIdentifier) {
                            $fieldDefinition = $this->contentTypeDomainMapper->buildFieldDefinitionDomainObject(
                                $spiFieldDefinition,
                                // This is probably not main language, but as we don't expose it, it's ok for now.
                                $languageCode
                            );
                            break;
                        }
                    }

                    if ($fieldDefinition === null) {
                        $fieldTitles[$fieldDefinitionIdentifier] = '';
                        continue;
                    }
                } elseif ($contentType instanceof ContentType) {
                    $fieldDefinition = $contentType->getFieldDefinition($fieldDefinitionIdentifier);
                } else {
                    throw new InvalidArgumentType('$contentType', 'API or SPI variant of ContentType');
                }

                $nameableFieldTypeService = $this->nameableFieldTypeRegistry->getFieldType(
                    $fieldDefinition->fieldTypeIdentifier
                );

                $fieldTitles[$fieldDefinitionIdentifier] = $nameableFieldTypeService->getFieldName(
                    $fieldMap[$fieldDefinitionIdentifier][$languageCode],
                    $fieldDefinition,
                    $languageCode
                );
            }
        }

        return $fieldTitles;
    }
protected function getFieldTitles(array $schemaIdentifiers, $contentType, array $fieldMap, $languageCode)
    {
        $fieldTitles = array();

        foreach ($schemaIdentifiers as $fieldDefinitionIdentifier) {
            if (isset($fieldMap[$fieldDefinitionIdentifier][$languageCode])) {
                if ($contentType instanceof SPIContentType) {
                    $fieldDefinition = null;
                    foreach ($contentType->fieldDefinitions as $spiFieldDefinition) {
                        if ($spiFieldDefinition->identifier === $fieldDefinitionIdentifier) {
                            $fieldDefinition = $this->contentTypeDomainMapper->buildFieldDefinitionDomainObject(
                                $spiFieldDefinition,
                                // This is probably not main language, but as we don't expose it, it's ok for now.
                                $languageCode
                            );
                            break;
                        }
                    }

                    if ($fieldDefinition === null) {
                        $fieldTitles[$fieldDefinitionIdentifier] = '';
                        continue;
                    }
                } elseif ($contentType instanceof ContentType) {
                    $fieldDefinition = $contentType->getFieldDefinition($fieldDefinitionIdentifier);
                } else {
                    throw new InvalidArgumentType('$contentType', 'API or SPI variant of ContentType');
                }

                $nameableFieldTypeService = $this->nameableFieldTypeRegistry->getFieldType(
                    $fieldDefinition->fieldTypeIdentifier
                );

                $fieldTitles[$fieldDefinitionIdentifier] = $nameableFieldTypeService->getFieldName(
                    $fieldMap[$fieldDefinitionIdentifier][$languageCode],
                    $fieldDefinition,
                    $languageCode
                );
            }
        }

        return $fieldTitles;
    }
protected function getFieldTitles ( array $ schemaIdentifiers , $ contentType , array $ fieldMap , $ languageCode ) { $ fieldTitles = array ( ) ; foreach ( $ schemaIdentifiers as $ fieldDefinitionIdentifier ) { if ( isset ( $ fieldMap [ $ fieldDefinitionIdentifier ] [ $ languageCode ] ) ) { if ( $ contentType instanceof SPIContentType ) { $ fieldDefinition = null ; foreach ( $ contentType -> fieldDefinitions as $ spiFieldDefinition ) { if ( $ spiFieldDefinition -> identifier === $ fieldDefinitionIdentifier ) { $ fieldDefinition = $ this -> contentTypeDomainMapper -> buildFieldDefinitionDomainObject ( $ spiFieldDefinition , // This is probably not main language, but as we don't expose it, it's ok for now. $ languageCode ) ; break ; } } if ( $ fieldDefinition === null ) { $ fieldTitles [ $ fieldDefinitionIdentifier ] = '' ; continue ; } } elseif ( $ contentType instanceof ContentType ) { $ fieldDefinition = $ contentType -> getFieldDefinition ( $ fieldDefinitionIdentifier ) ; } else { throw new InvalidArgumentType ( '$contentType' , 'API or SPI variant of ContentType' ) ; } $ nameableFieldTypeService = $ this -> nameableFieldTypeRegistry -> getFieldType ( $ fieldDefinition -> fieldTypeIdentifier ) ; $ fieldTitles [ $ fieldDefinitionIdentifier ] = $ nameableFieldTypeService -> getFieldName ( $ fieldMap [ $ fieldDefinitionIdentifier ] [ $ languageCode ] , $ fieldDefinition , $ languageCode ) ; } } return $ fieldTitles ; }
Fetches the list of available Field identifiers in the token and returns
an array of their current title value.

@see \eZ\Publish\Core\Repository\FieldType::getName()

@param string[] $schemaIdentifiers
@param \eZ\Publish\SPI\Persistence\Content\Type|\eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType
@param array $fieldMap
@param string $languageCode

@throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentType

@return string[] Key is the field identifier, value is the title value
Fetches the list of available Field identifiers in the token and returns an array of their current title value .