loadClass($class) ) { $class = sprintf(self::$_namespace, 'Node'); trigger_error( sprintf( __('Could not load class "%1$s"'), $class ), E_USER_ERROR ); } return $class; } /** * Instantiates a Node object * * @param string $class The name of the class to instantiate * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes * * @return mixed */ public static function getInstance( $class = 'Node', $name = 'default', $type = Node::OBJECT, $is_group = false ) { $class = self::_sanitizeClass($class); return new $class($name, $type, $is_group); } }