Esempio n. 1
0
 /**
  * Returns a Filter that matches all hosts in this list
  *
  * @return Filter
  */
 public function objectsFilter($columns = array('host' => 'host'))
 {
     $filterExpression = array();
     foreach ($this as $host) {
         $filterExpression[] = Filter::where($columns['host'], $host->getName());
     }
     return FilterOr::matchAny($filterExpression);
 }
Esempio n. 2
0
 /**
  * Returns a Filter that matches all hosts in this HostList
  *
  * @param   array   $columns    Override filter column names
  *
  * @return  Filter
  */
 public function objectsFilter($columns = array('host' => 'host', 'service' => 'service'))
 {
     $filterExpression = array();
     foreach ($this as $service) {
         $filterExpression[] = Filter::matchAll(Filter::where($columns['host'], $service->getHost()->getName()), Filter::where($columns['service'], $service->getName()));
     }
     return FilterOr::matchAny($filterExpression);
 }