private function resolveNewFieldDefinitionIdentifier(
        ContentTypeDraft $contentTypeDraft,
        int $startIndex,
        string $fieldTypeIdentifier
    ): string {
        $fieldDefinitionIdentifiers = array_map(function (FieldDefinition $fieldDefinition) {
            return $fieldDefinition->identifier;
        }, $contentTypeDraft->getFieldDefinitions());

        do {
            $fieldDefinitionIdentifier = sprintf('new_%s_%d', $fieldTypeIdentifier, ++$startIndex);
        } while (in_array($fieldDefinitionIdentifier, $fieldDefinitionIdentifiers, true));

        return $fieldDefinitionIdentifier;
    }
private function resolveNewFieldDefinitionIdentifier(
        ContentTypeDraft $contentTypeDraft,
        int $startIndex,
        string $fieldTypeIdentifier
    ): string {
        $fieldDefinitionIdentifiers = array_map(function (FieldDefinition $fieldDefinition) {
            return $fieldDefinition->identifier;
        }, $contentTypeDraft->getFieldDefinitions());

        do {
            $fieldDefinitionIdentifier = sprintf('new_%s_%d', $fieldTypeIdentifier, ++$startIndex);
        } while (in_array($fieldDefinitionIdentifier, $fieldDefinitionIdentifiers, true));

        return $fieldDefinitionIdentifier;
    }
private function resolveNewFieldDefinitionIdentifier ( ContentTypeDraft $ contentTypeDraft , int $ startIndex , string $ fieldTypeIdentifier ) : string { $ fieldDefinitionIdentifiers = array_map ( function ( FieldDefinition $ fieldDefinition ) { return $ fieldDefinition -> identifier ; } , $ contentTypeDraft -> getFieldDefinitions ( ) ) ; do { $ fieldDefinitionIdentifier = sprintf ( 'new_%s_%d' , $ fieldTypeIdentifier , ++ $ startIndex ) ; } while ( in_array ( $ fieldDefinitionIdentifier , $ fieldDefinitionIdentifiers , true ) ) ; return $ fieldDefinitionIdentifier ; }
Resolves unique field definition identifier.

@param ContentTypeDraft $contentTypeDraft
@param int $startIndex
@param string $fieldTypeIdentifier

@return string
Resolves unique field definition identifier .