getDb()); $queryHost->getSelectBase(); $hostStatusCols = [ 'host_name' => 'name', 'host_address' => 'address', 'host_address6' => 'address6' ]; $queryHost = $queryHost->columns($hostStatusCols); $this->applyRestrictions($queryHost); if ($filter !== null) { $queryString = $filter->toQueryString(); $filterCondition = QueryString::parse($queryString); $queryHost->filter($filterCondition); } $hosts = $this->getdb()->select($queryHost->assembleSelect()); foreach ($hosts as $host) { if (! empty($host->host_address)) { yield $host->host_address => $host->host_name; } if (! empty($host->host_address6)) { yield $host->host_address6 => $host->host_name; } } } }