function field_test_entity_info_translatable

7.x field_test.entity.inc field_test_entity_info_translatable($entity_type = NULL, $translatable = NULL)

Helper function to enable entity translations.

9 calls to field_test_entity_info_translatable()
EntityFieldQueryTestCase::testEntityFieldQueryMetaConditions in drupal-7.x/modules/simpletest/tests/entity_query.test
Tests field meta conditions.
EntityFieldQueryTestCase::testEntityFieldQueryTranslatable in drupal-7.x/modules/simpletest/tests/entity_query.test
Tests querying translatable fields.
FieldTranslationsTestCase::testFieldAvailableLanguages in drupal-7.x/modules/field/tests/field.test
Ensures that only valid values are returned by field_available_languages().
FieldTranslationsTestCase::testFieldDisplayLanguage in drupal-7.x/modules/field/tests/field.test
Tests display language logic for translatable fields.
FieldTranslationsTestCase::testFieldFormTranslationRevisions in drupal-7.x/modules/field/tests/field.test
Tests field translations when creating a new revision.

... See full list

File

drupal-7.x/modules/field/tests/field_test.entity.inc, line 146
Defines an entity type.

Code

function field_test_entity_info_translatable($entity_type = NULL, $translatable = NULL) {
  drupal_static_reset('field_has_translation_handler');
  $stored_value = &drupal_static(__FUNCTION__, array());
  if (isset($entity_type)) {
    $stored_value[$entity_type] = $translatable;
    entity_info_cache_clear();
  }
  return $stored_value;
}