Title: OptionEnum::determineClassEnumerations
Published: May 20, 2026

---

# OptionEnum::determineClassEnumerations( WordPressAiClientProvidersModelsEnumsclass-string $className ): WordPressAiClientProvidersModelsEnumsarray<string,

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#wp--skip-link--target)

Determines the class enumerations by reflecting on class constants.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#description)󠁿

Overrides the parent method to dynamically add constants from ModelConfig that are
prefixed with KEY_. These are transformed to remove the KEY_ prefix and converted
to snake_case values.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#parameters)󠁿

 `$className`WordPressAiClientProvidersModelsEnumsclass-stringrequired

The fully qualified class name.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#return)󠁿

 WordPressAiClientProvidersModelsEnumsarray<string, string> The enum constants.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#source)󠁿

    ```php
    protected static function determineClassEnumerations(string $className): array
    {
        // Start with the constants defined in this class using parent method
        $constants = parent::determineClassEnumerations($className);
        // Use reflection to get all constants from ModelConfig
        $modelConfigReflection = new ReflectionClass(ModelConfig::class);
        $modelConfigConstants = $modelConfigReflection->getConstants();
        // Add ModelConfig constants that start with KEY_
        foreach ($modelConfigConstants as $constantName => $constantValue) {
            if (str_starts_with($constantName, 'KEY_')) {
                // Remove KEY_ prefix to get the enum constant name
                $enumConstantName = substr($constantName, 4);
                // The value is the snake_case version stored in ModelConfig
                // ModelConfig already stores these as snake_case strings
                if (is_string($constantValue)) {
                    $constants[$enumConstantName] = $constantValue;
                }
            }
        }
        return $constants;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/php-ai-client/src/providers/models/enums/optionenum.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/php-ai-client/src/Providers/Models/Enums/OptionEnum.php#L86)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/Providers/Models/Enums/OptionEnum.php#L86-L106)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#related)󠁿

| Uses | Description | 
| [AbstractEnum::determineClassEnumerations()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-common-abstractenum/determineclassenumerations/)`wp-includes/php-ai-client/src/Common/AbstractEnum.php` |

Determines the class enumerations by reflecting on class constants.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wordpress-aiclient-providers-models-enums-optionenum/determineclassenumerations/?output_format=md#changelog)󠁿

| Version | Description | 
| [0.1.0](https://developer.wordpress.org/reference/since/0.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwordpress-aiclient-providers-models-enums-optionenum%2Fdetermineclassenumerations%2F)
before being able to contribute a note or feedback.