private function GetFilterConditionAsSQL(Dataset $dataset, FilterCondition $filter) { if (count($filter->GetValues()) == 0 && count($filter->GetDisplayValues()) > 0) { $newFilter = new FilterCondition($dataset->IsLookupFieldByPrimaryName($filter->GetFieldName()), $filter->GetOperator(), $filter->GetDisplayValue(0)); $legacyFilter = $this->CreateLegacyFilter($newFilter); } else { $legacyFilter = $this->CreateLegacyFilter($filter); } return $this->legacyGenerator->CreateCondition($legacyFilter, $dataset->GetFieldInfoByName($filter->GetFieldName())); }
private function GetFilterConditionAsSQL(Dataset $dataset, FilterCondition $filter) { if ($filter->GetValue(0) == '' && $filter->GetDisplayValue() != '') { $newFilter = new FilterCondition($dataset->IsLookupFieldByPrimaryName($filter->GetFieldName()), $filter->GetOperator(), $filter->GetDisplayValue()); $legacyFilter = $this->CreateLegacyFilter($newFilter); return $this->legacyGenerator->CreateCondition($legacyFilter, $dataset->GetFieldInfoByName($newFilter->GetFieldName())); } else { $legacyFilter = $this->CreateLegacyFilter($filter); return $this->legacyGenerator->CreateCondition($legacyFilter, $dataset->GetFieldInfoByName($filter->GetFieldName())); } /*return StringUtils::Format('(%s %s %s)', $filter->GetFieldName(), $this->GetConditionOperatorAsSQL($filter->GetOperator()), $this->GetFieldValueAsSQL($filter->GetFieldName(), $filter->GetValue(0)) );*/ }