Share » Forums » Developer » Working with Arrays and Nodes

Working with Arrays and Nodes

Working with Arrays and Nodes

Wednesday 15 June 2011 2:51:54 am - 4 replies

Author Message

Carlos Revillo

Wednesday 15 June 2011 3:42:42 am

hi Alejandro. i think what you need is append function. something like:

 {def $myarray = array()}
{set $myarray = $myarray|append( $node )}

but, without knowing properly what you are trying to achieve, i would say, in general is not a good idea to fetch all nodes and add them to another array only if they pass specific conditions. 

if those nodes are taken by a fetch, i would go for a way (probably a custom function or whatever) trying to only return the nodes you need from database, instead of fetching all if you don't need all of them. 

Marko Žmak

Wednesday 15 June 2011 7:03:12 am

if those nodes are taken by a fetch, i would go for a way (probably a custom function or whatever) trying to only return the nodes you need from database, instead of fetching all if you don't need all of them. 

An extended attribute filter would probably be the best.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Carlos Revillo

Wednesday 15 June 2011 7:06:54 am

An extended attribute filter would probably be the best.

yep. sure!. or even better, an ezfind query :).

Alejandro Dominguez

Friday 17 June 2011 2:03:16 am

Hi Carlos & Marko!

The Append solution has worked well!  The extended attribute filter seems to be a better solution, so I'm going to try this now.

 

Thanks for your answers :)

 

cheers

Alejandro

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu