function field_test_entity_test_load

Loads a test_entity.

Parameters

$ftid: The id of the entity to load.

$ftvid: (Optional) The revision id of the entity to load. If not specified, the current revision will be used.

Return value

The loaded entity.

7 calls to field_test_entity_test_load()
FormTest::testFieldFormAccess in drupal/core/modules/field/lib/Drupal/field/Tests/FormTest.php
Tests fields with no 'edit' access.
FormTest::testFieldFormDefaultValue in drupal/core/modules/field/lib/Drupal/field/Tests/FormTest.php
Tests field widget default values on entity forms.
FormTest::testFieldFormHiddenWidget in drupal/core/modules/field/lib/Drupal/field/Tests/FormTest.php
Tests the Hidden widget.
FormTest::testFieldFormSingle in drupal/core/modules/field/lib/Drupal/field/Tests/FormTest.php
FormTest::testFieldFormSingleRequired in drupal/core/modules/field/lib/Drupal/field/Tests/FormTest.php

... See full list

File

drupal/core/modules/field/tests/modules/field_test/field_test.entity.inc, line 180
Defines an entity type.

Code

function field_test_entity_test_load($ftid, $ftvid = NULL) {

  // Prevent this from being called as hook_entity_test_load().
  if (is_array($ftid)) {
    return;
  }
  $ids = isset($ftid) ? array(
    $ftid,
  ) : array();
  $conditions = isset($ftvid) ? array(
    'ftvid' => $ftvid,
  ) : array();
  $test_entity = entity_load_multiple('test_entity', $ids, $conditions);
  return $test_entity ? reset($test_entity) : FALSE;
}