function message_type_category_create in Message 7
Creates a new message type category.
If a message type category already exists, an exception will be thrown.
Return value
MessageTypeCategory Returns a new message type category object.
File
- ./
message.module, line 737 - API functions to manipulate messages.
Code
function message_type_category_create($category, $values = array()) {
global $language;
// Make sure the message type doesn't already exist, to prevent duplicate key
// error.
if (message_type_category_load($category)) {
throw new MessageException('Message type category' . check_plain($category) . ' already exists.');
}
$values['category'] = $category;
$values += array(
'language' => $language->language,
);
$return = entity_create('message_type_category', $values);
return $return;
}