function og_membership_type_load in Organic groups 7.2
Same name and namespace in other branches
- 7 og.module \og_membership_type_load()
OG membership type loader.
Parameters
$type_name: (optional) The name for this message type. If no type is given all existing types are returned.
Return value
MessageType Returns a fully-loaded message type definition if a type name is passed. Else an array containing all types is returned.
5 calls to og_membership_type_load()
- OgMembership::type in includes/
og.membership.inc - Gets the associated OG membership type.
- OgSelectionHandler::settingsForm in plugins/
entityreference/ selection/ OgSelectionHandler.class.php - Override EntityReferenceHandler::settingsForm().
- og_membership_type_create in ./
og.module - Creates a new membership type.
- og_ui_membership_links_content_type_edit_form in og_ui/
plugins/ content_types/ membership_links/ membership_links.inc - Edit form.
- og_ui_subscribe_get_types in og_ui/
plugins/ content_types/ membership_links/ membership_links.inc - Get the membership types defined in the pane's $conf.
1 string reference to 'og_membership_type_load'
- og_membership_type_form in includes/
og.admin.inc - Generates the message type editing form.
File
- ./
og.module, line 1193 - Enable users to create and manage groups with roles and permissions.
Code
function og_membership_type_load($name = NULL) {
// Replace dashes with underscores so this can be used as menu argument
// loader too.
$types = entity_load_multiple_by_name('og_membership_type', isset($name) ? array(
strtr($name, array(
'-' => '_',
)),
) : FALSE);
if (isset($name)) {
return isset($types[$name]) ? $types[$name] : FALSE;
}
return $types;
}