You are here

function entity_test_get_types in Entity API 7

Gets an array of all test entity types, keyed by the name.

Parameters

$name: If set, the type with the given name is returned.

2 calls to entity_test_get_types()
EntityClass::defaultLabel in tests/entity_test.module
Specifies the default label, which is picked up by label() by default.
entity_crud_hook_entity_info in ./entity.api.php
Provide an entity type via the entity CRUD API.

File

tests/entity_test.module, line 97
Test module for the entity API.

Code

function entity_test_get_types($name = NULL) {
  $types = entity_load_multiple_by_name('entity_test_type', isset($name) ? array(
    $name,
  ) : FALSE);
  return isset($name) ? reset($types) : $types;
}