function newsletter_template_get_types in Newsletter 7.2
Gets an array of all newsletter template types, keyed by the type name.
Parameters
$type_name: If set, the type with the given name is returned.
Return value
NeswletterTemplateType[] Depending whether $type isset, an array of newsletter template types or a single one.
2 calls to newsletter_template_get_types()
- newsletter_template_permission in modules/
template/ newsletter_template.module - Implements hook_permission().
- newsletter_template_type_load in modules/
template/ newsletter_template.module - Menu argument loader; Load a template type by string.
1 string reference to 'newsletter_template_get_types'
- newsletter_template_type_form in modules/
template/ includes/ newsletter_template.admin.inc - Form callback: create or edit a template type.
File
- modules/
template/ newsletter_template.module, line 223 - Module for the Newsletter Template Entity
Code
function newsletter_template_get_types($type_name = NULL) {
$types = entity_load_multiple_by_name('newsletter_template_type', isset($type_name) ? array(
$type_name,
) : FALSE);
return isset($type_name) ? reset($types) : $types;
}