function messaging_check_object in Messaging 6.4
Same name and namespace in other branches
- 7 messaging.module \messaging_check_object()
Check that a parameter is an instance of a given class
2 calls to messaging_check_object()
- messaging_message_build in ./
messaging.module - Build message object from object or array
- messaging_token_values in ./
messaging.module - Implementation of hook_token_values()
File
- ./
messaging.module, line 703
Code
function messaging_check_object($object, $class, $create = FALSE) {
if ($object && is_object($object) && is_a($object, $class)) {
return $object;
}
elseif ($create) {
return new $class($object);
}
}