Welcome Guest, Not a member yet? Register   Sign In
Mahana Hierarchy library
#11

[eluser]jmadsen[/eluser]
yes, i think that's why a config will be the better way to go.

I'll have a look at adding that today if I get time
#12

[eluser]jmadsen[/eluser]
Couple quick updates:

1) now uses $config and an initialize method, so you can use multiple instances in site or even same page

2) composer package available: https://packagist.org/packages/jrmadsen6...-hierarchy

Careful - I've renamed $_db to $db & $_table to $table as you can now pass these as $config keys
#13

[eluser]jmadsen[/eluser]
And a couple more :-)

(I'm actively using this in a site I'm working on, so adding things as I find I need them)


get_ancestors($id, $remove_this = false)

Returns an array of all the ancestors of the given record. Second parameter will leave out the requesting record or not

get_parent($id)

Returns an row array of the parent of the given record.




Theme © iAndrew 2016 - Forum software by © MyBB