function profile2_get_types in Profile 2 7.2
Same name and namespace in other branches
- 7 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.
31 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_admin_paths in ./
profile2.module - Implements hook_admin_paths().
- profile2_attach_form in ./
profile2.module - Attaches the profile forms of the profiles set in $form_state['profiles'].
- profile2_diff_admin_paths in contrib/
profile2_diff.module - Implements hook_admin_paths().
- profile2_diff_block_configure in contrib/
profile2_diff.module - Implements hook_block_configure().
1 string reference to 'profile2_get_types'
- profile2_type_form in ./
profile2.admin.inc - Generates the profile type editing form.
File
- ./
profile2.module, line 373 - 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;
}