You are here

function profile2_get_types in Profile 2 7

Same name and namespace in other branches
  1. 7.2 profile2.module \profile2_get_types()

Gets an array of all profile types, keyed by the type name.

Parameters

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

Return value

ProfileType[] Depending whether $type isset, an array of profile types or a single one.

20 calls to profile2_get_types()
Profile2CRUDTestCase::testCRUD in ./profile2.test
Tests CRUD for a profile related to a user and one unrelated to a user.
profile2_entity_property_info_alter in ./profile2.info.inc
Implements hook_entity_property_info_alter().
profile2_field_extra_fields in ./profile2.module
Implements hook_field_extra_fields().
profile2_form in contrib/profile2_page.inc
The profile edit form.
profile2_form_user_profile_form_alter in ./profile2.module
Implements hook_form_FORM_ID_alter() for the user edit form.

... See full list

1 string reference to 'profile2_get_types'
profile2_type_form in ./profile2.admin.inc
Generates the profile type editing form.

File

./profile2.module, line 212
Support for configurable user profiles.

Code

function profile2_get_types($type_name = NULL) {
  $types = entity_load_multiple_by_name('profile2_type', isset($type_name) ? array(
    $type_name,
  ) : FALSE);
  return isset($type_name) ? reset($types) : $types;
}