/** * Returns true if schema contains function with given $declaration, otherwise false. * * @param $declaration declaration of the function * * @return true if schema contains function with given $declaration, otherwise false */ public static function contains_function($node_schema, $declaration) { $found = false; foreach (dbx::get_functions($node_schema) as $node_function) { if (strcasecmp(format_function::get_declaration($node_schema, $node_function, FALSE), $declaration) == 0) { $found = true; break; } } return $found; }
public static function &get_functions(&$node_schema) { $nodes = $node_schema->xpath("function"); // filter out versions of functon in languages that are not relevant to the current format being processed $filtered_nodes = array(); foreach ($nodes as $node) { if (format_function::has_definition($node)) { $filtered_nodes[] = $node; } } return $filtered_nodes; }