Retrieves a list of features that are enabled for the user. Invoking this method is equivalent to running Is Feature Enabled for each feature in the datafile sequentially.
This method takes into account the user
attributes passed in, to determine if the user is part of the audience that qualifies for the experiment.
This method iterates through all feature flags and for each feature flag invokes Is Feature Enabled. If a feature is enabled, this method adds the feature’s key to the return list.
The table below lists the required and optional parameters in PHP.
The ID of the user to check.
A map of custom key-value string pairs specifying attributes for the user that are used for audience targeting. Non-string values are only supported in the 3.0 SDK and above.
List of feature flag keys.
This section shows a simple example of how you can use the method.
$enabledFeatures = $optimizelyClient->getEnabledFeatures('my_user', $userAttributes);
This method has all the same arguments as Is Feature Enabled and also triggers impressions for any feature tests activated in the process.
The language/platform source files containing the implementation for PHP is Optimizely.php.
Updated over 2 years ago