GetSQLColSpec() : ''); } public function GetValidationPattern() { return "^[0-9]+$"; } public function GetBasicFilterOperators() { return array( "!=" => "differs from", "=" => "equals", ">" => "greater (strict) than", ">=" => "greater than", "<" => "less (strict) than", "<=" => "less than", "in" => "in" ); } public function GetBasicFilterLooseOperator() { // Unless we implement an "equals approximately..." or "same order of magnitude" return "="; } public function GetBasicFilterSQLExpr($sOpCode, $value) { $sQValue = CMDBSource::Quote($value); switch ($sOpCode) { case '!=': return $this->GetSQLExpr() . " != $sQValue"; break; case '>': return $this->GetSQLExpr() . " > $sQValue"; break; case '>=': return $this->GetSQLExpr() . " >= $sQValue"; break; case '<': return $this->GetSQLExpr() . " < $sQValue"; break; case '<=': return $this->GetSQLExpr() . " <= $sQValue"; break; case 'in': if (!is_array($value)) { throw new CoreException("Expected an array for argument value (sOpCode='$sOpCode')"); } return $this->GetSQLExpr() . " IN ('" . implode("', '", $value) . "')"; break; case '=': default: return $this->GetSQLExpr() . " = \"$value\""; } } public function GetNullValue() { return null; } public function IsNull($proposedValue) { return is_null($proposedValue); } /** * @inheritDoc */ public function HasAValue($proposedValue): bool { return utils::IsNotNullOrEmptyString($proposedValue); } public function MakeRealValue($proposedValue, $oHostObj) { if (is_null($proposedValue)) { return null; } if ($proposedValue === '') { return null; } // 0 is transformed into '' ! return (int)$proposedValue; } public function ScalarToSQL($value) { assert(is_numeric($value) || is_null($value)); return $value; // supposed to be an int } }