protected function filterList(array $nodes = array(), array $rules = array())
  {
    if(!empty($rules))
    {
      foreach($nodes as $node)
      {
        if(!$node instanceof Node) continue;

        $props = $node->getInfo(FALSE);
        $props = array_intersect_key($props, $rules);

        foreach($props as $key => $val)
        {
          if($val instanceof Str)
          {
            $match = $val->contains($rules[$key], TRUE);
          }
          else
          {
            $match = $val == $rules[$key];
          }

          if($match === FALSE)
          {
            unset($nodes[$node->getId()]);
          }
        }
      }
    }

    return $nodes;
  }
protected function filterList(array $nodes = array(), array $rules = array())
  {
    if(!empty($rules))
    {
      foreach($nodes as $node)
      {
        if(!$node instanceof Node) continue;

        $props = $node->getInfo(FALSE);
        $props = array_intersect_key($props, $rules);

        foreach($props as $key => $val)
        {
          if($val instanceof Str)
          {
            $match = $val->contains($rules[$key], TRUE);
          }
          else
          {
            $match = $val == $rules[$key];
          }

          if($match === FALSE)
          {
            unset($nodes[$node->getId()]);
          }
        }
      }
    }

    return $nodes;
  }
protected function filterList ( array $ nodes = array ( ) , array $ rules = array ( ) ) { if ( ! empty ( $ rules ) ) { foreach ( $ nodes as $ node ) { if ( ! $ node instanceof Node ) continue ; $ props = $ node -> getInfo ( FALSE ) ; $ props = array_intersect_key ( $ props , $ rules ) ; foreach ( $ props as $ key => $ val ) { if ( $ val instanceof Str ) { $ match = $ val -> contains ( $ rules [ $ key ] , TRUE ) ; } else { $ match = $ val == $ rules [ $ key ] ; } if ( $ match === FALSE ) { unset ( $ nodes [ $ node -> getId ( ) ] ) ; } } } } return $ nodes ; }
Filters given node list array using specified filter rules.

@param  array $nodes
@param  array $rules
@return array
Filters given node list array using specified filter rules .