You are here

function nodehierarchy_node_can_be_child_of in Node Hierarchy 6.2

Same name and namespace in other branches
  1. 5 nodehierarchy.module \nodehierarchy_node_can_be_child_of()
  2. 6.3 nodehierarchy.module \nodehierarchy_node_can_be_child_of()
  3. 6 nodehierarchy.module \nodehierarchy_node_can_be_child_of()
  4. 7.4 nodehierarchy.admin.inc \nodehierarchy_node_can_be_child_of()
  5. 7.2 nodehierarchy.module \nodehierarchy_node_can_be_child_of()

Determine if a given node can be a child of another given node.

Parameters

$parent: The potentential parent node (can be null for any node).

$child: The potential child node (can be null for any node).

Return value

Boolean. Whether second node can be a child of the first.

File

./nodehierarchy.module, line 890
A module to make nodes hierarchical.

Code

function nodehierarchy_node_can_be_child_of($parent = NULL, $child = NULL) {
  return in_array($child->type, nodehierarchy_get_allowed_child_types($parent->type));
}