$column) { if (in_array($column, $entity_info['schema_fields_sql']['base table'])) { $providers[] = array( 'provider' => synonyms_provider_property_provider_name($column), 'label' => $entity_key, 'class' => $class, ); unset($properties[$column]); } } foreach ($properties as $property => $property_info) { if (isset($property_info['schema field']) && $property_info['schema field']) { $providers[] = array( 'provider' => synonyms_provider_property_provider_name($property_info['schema field']), 'label' => $property_info['label'], 'class' => $class, ); } } } break; } return $providers; } /** * Construct synonyms provider name out of underlying property. * * This function is inverse of synonyms_provider_property_name(). * * @param string $property * Entity property name whose provider name should be constructed * * @return string * Provider name that corresponds to the $property * * @see synonyms_provider_property_name() */ function synonyms_provider_property_provider_name($property) { return 'synonyms_provider_property_' . $property; } /** * Reconstruct entity property name from the name of its provider. * * This function is inverse of synonyms_provider_property_provider_name(). * * @param string $provider * Name of the provider whose underlying entity property should be * reconstructed * * @return string * Entity property name that corresponds to the $provider * * @see synonyms_provider_property_provider_name() */ function synonyms_provider_property_name($provider) { return drupal_substr($provider, drupal_strlen('synonyms_provider_property_')); }