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

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

        foreach($props as $key => $val)
        {
          if($val instanceof \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String)
          {
            $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 AbstractNode) continue;

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

        foreach($props as $key => $val)
        {
          if($val instanceof \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String)
          {
            $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 AbstractNode ) continue ; $ props = $ node -> getInfo ( FALSE ) ; $ props = array_intersect_key ( $ props , $ rules ) ; $ match = TRUE ; foreach ( $ props as $ key => $ val ) { if ( $ val instanceof \ ManiaLivePlugins \ Standard \ TeamSpeak \ TeamSpeak3 \ Helper \ String ) { $ 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 .