since $node-taxonomy would already contain the terms related to that node? Under what circumstances would that function yield a different result?

Comments

WorldFallz’s picture

I don't think it would or should.

docwilmot’s picture

sorry, didnt understand your response. are you saying $node->taxonomy 'would or should' not contain terms attached to that node or that the function 'would or should' not return a different result? (and if the latter, then why would anyone use this function - and the extra database call - at all?)
thanks

-------------------------------------------------
Always be nice to people on the way up; because you'll meet the same people on the way down.
Wilson Mizner (1876 - 1933)

WorldFallz’s picture

The taxonomy terms associated with a node are the same whether you use the function or the object. And you would use the function if the node object isn't fully loaded yet or if you wanted a non rendered array version for code purposes (which is probably why the function no longer exists in d7).

yelvington’s picture

taxonomy_node_get_terms_by_vocabulary($node, $vid, $key = 'tid')

This function returns terms for the referenced vocabulary, not all terms related to the node.

For D7, taxonomy terms are fields, and the whole system is quite different. See discussion here:

http://timonweb.com/comment/4769

WorldFallz’s picture

duh... good point!

docwilmot’s picture

thanks very much for your replies.
i had recognized that the function is 'by vocabulary', but in $node its $node->taxonomy[$vid] anyway so still, it seems not much point in calling the function in most cases if you already have to load '$node' first...
but you've answered my question, and thanks.
by the way, D7 implementation seems a much better way to do things. thanks for the link.

-------------------------------------------------
Always be nice to people on the way up; because you'll meet the same people on the way down.
Wilson Mizner (1876 - 1933)