public function set_viable_parents(&$parentstrings, $category) {

        unset($parentstrings[$category->id]);
        if (isset($category->children)) {
            foreach ($category->children as $child) {
                $this->set_viable_parents($parentstrings, $child);
            }
        }
    }
public function set_viable_parents(&$parentstrings, $category) {

        unset($parentstrings[$category->id]);
        if (isset($category->children)) {
            foreach ($category->children as $child) {
                $this->set_viable_parents($parentstrings, $child);
            }
        }
    }
public function set_viable_parents ( & $ parentstrings , $ category ) { unset ( $ parentstrings [ $ category -> id ] ) ; if ( isset ( $ category -> children ) ) { foreach ( $ category -> children as $ child ) { $ this -> set_viable_parents ( $ parentstrings , $ child ) ; } } }
Sets the viable parents

Viable parents are any except for the category itself, or any of it's descendants
The parentstrings parameter is passed by reference and changed by this function.

@param    array parentstrings a list of parentstrings
@param   object category
Sets the viable parents