function field_test_entity_info_translatable

Helper function to enable entity translations.

7 calls to field_test_entity_info_translatable()
field_test_entity_info_alter in drupal/core/modules/field/tests/modules/field_test/field_test.entity.inc
Implements hook_entity_info_alter().
TranslationTest::testFieldAvailableLanguages in drupal/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
Ensures that only valid values are returned by field_available_languages().
TranslationTest::testFieldDisplayLanguage in drupal/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
Tests display language logic for translatable fields.
TranslationTest::testFieldInvoke in drupal/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
Test the multilanguage logic of _field_invoke().
TranslationTest::testFieldInvokeMultiple in drupal/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
Test the multilanguage logic of _field_invoke_multiple().

... See full list

File

drupal/core/modules/field/tests/modules/field_test/field_test.entity.inc, line 73
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;
}