function node_type_get_base
Returns the node type base of the passed node or node type string.
The base indicates which module implements this node type and is used to execute node-type-specific hooks. For types defined in the user interface and managed by node.module, the base is 'node_content'.
Parameters
$node: A node object or string that indicates the node type to return.
Return value
The node type base or FALSE if the node type is not found.
See also
6 calls to node_type_get_base()
- NodeController::attachLoad in modules/
node/ node.module - Attaches data to entities upon loading.
- NodeTypeTestCase::testNodeTypeGetFunctions in modules/
node/ node.test - Ensures that node type functions (node_type_get_*) work correctly.
- node_form in modules/
node/ node.pages.inc - Form constructor for the node add/edit form.
- node_hook in modules/
node/ node.module - Determines whether a node hook exists.
- node_invoke in modules/
node/ node.module - Invokes a node hook.
File
-
modules/
node/ node.module, line 431
Code
function node_type_get_base($node) {
$type = _node_extract_type($node);
$types = _node_types_build()->types;
return isset($types[$type]) && isset($types[$type]->base) ? $types[$type]->base : FALSE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.