Skip to content

Call to a member function match() on a non-object in ganon.php on line 1551 #66

Description

@GoogleCodeExporter
The problem cames when there is bad nodes.

The solution : 

function getChildrenByMatch($conditions, $recursive = true, $check_self = 
false, $custom_filters = array()) {
        $count = $this->childCount();
        if ($check_self && $this->match($conditions, true, $custom_filters)) {
            $res = array($this);
        } else {
            $res = array();
        }
        if ($count > 0) {
            if (is_int($recursive)) {
                $recursive = (($recursive > 1) ? $recursive - 1 : false);
            }
            for ($i = 0; $i < $count; $i++) {
                ++if (!isset($this->children[$i]))
                ++  continue;

                if ($this->children[$i]->match($conditions, true, $custom_filters)) {
                    $res[] = $this->children[$i];
                }
                if ($recursive) {
                    $res = array_merge($res, $this->children[$i]->getChildrenByMatch($conditions, $recursive, false, $custom_filters));
                }
            }
        }
        return $res;
    }

Thanks for this library

Original issue reported on code.google.com by Alel...@gmail.com on 26 Nov 2014 at 1:59

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions