You are here

function message_type_load in Message 7

Message type loader.

Parameters

$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.

7 calls to message_type_load()
Message::getType in includes/message.message.inc
Gets the associated message type.
MessageShowMessage::testMessageView in tests/message.test
Test showing a message.
message_cron in ./message.module
Implements hook_cron().
message_field_extra_fields in ./message.module
Implements hook_field_extra_fields().
message_handler_filter_message_type::get_value_options in includes/views/handlers/message_handler_filter_message_type.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

... See full list

1 string reference to 'message_type_load'
message_type_form in includes/message.admin.inc
Generates the message type editing form.

File

./message.module, line 833
API functions to manipulate messages.

Code

function message_type_load($name = NULL) {

  // Replace dashes with underscores so this can be used as menu argument
  // loader too.
  $types = entity_load_multiple_by_name('message_type', isset($name) ? array(
    strtr($name, array(
      '-' => '_',
    )),
  ) : FALSE);
  if (isset($name)) {
    return isset($types[$name]) ? $types[$name] : FALSE;
  }
  return $types;
}