pQuery\DomNode::match_filters PHP Method

match_filters() protected method

Checks if node matches certain filters
See also: match()
protected match_filters ( $conditions, array $custom_filters = [] ) : boolean
$custom_filters array Custom map next to {@link $filter_map}
return boolean
    protected function match_filters($conditions, $custom_filters = array())
    {
        foreach ($conditions as $c) {
            $c['filter'] = strtolower($c['filter']);
            if (isset($this->filter_map[$c['filter']])) {
                if (!$this->{$this->filter_map[$c['filter']]}($c['params'])) {
                    return false;
                }
            } elseif (isset($custom_filters[$c['filter']])) {
                if (!call_user_func($custom_filters[$c['filter']], $this, $c['params'])) {
                    return false;
                }
            } else {
                trigger_error('Unknown filter "' . $c['filter'] . '"!');
                return false;
            }
        }
        return true;
    }
DomNode