/** * {@inheritdoc} */ protected static function extractAllowedValues($string, $has_data) { $values = parent::extractAllowedValues($string, $has_data); if ($values) { $keys = array_keys($values); $labels = array_values($values); $keys = array_map(function ($key) { // Float keys are represented as strings and need to be disambiguated // ('.5' is '0.5'). return is_numeric($key) ? (string) (double) $key : $key; }, $keys); return array_combine($keys, $labels); } }
/** * {@inheritdoc} */ public static function defaultStorageSettings() { return array('workflow_type' => '', 'allowed_values_function' => 'workflow_state_allowed_values') + parent::defaultStorageSettings(); }