|
@@ -130,6 +130,7 @@ abstract class AttributeDefinition
|
|
public function IsExternalField() {return false;}
|
|
public function IsExternalField() {return false;}
|
|
public function IsWritable() {return false;}
|
|
public function IsWritable() {return false;}
|
|
public function IsNullAllowed() {return true;}
|
|
public function IsNullAllowed() {return true;}
|
|
|
|
+ public function GetNullValue() {return null;}
|
|
public function GetCode() {return $this->m_sCode;}
|
|
public function GetCode() {return $this->m_sCode;}
|
|
public function GetLabel() {return $this->Get("label");}
|
|
public function GetLabel() {return $this->Get("label");}
|
|
public function GetDescription() {return $this->Get("description");}
|
|
public function GetDescription() {return $this->Get("description");}
|
|
@@ -328,7 +329,6 @@ class AttributeDBFieldVoid extends AttributeDefinition
|
|
public function IsNullAllowed() {return false;}
|
|
public function IsNullAllowed() {return false;}
|
|
|
|
|
|
protected function ScalarToSQL($value) {return $value;} // format value as a valuable SQL literal (quoted outside)
|
|
protected function ScalarToSQL($value) {return $value;} // format value as a valuable SQL literal (quoted outside)
|
|
- protected function SQLToScalar($value) {return $value;} // take the result of a fetch... and make it a PHP variable
|
|
|
|
|
|
|
|
public function GetSQLExpressions()
|
|
public function GetSQLExpressions()
|
|
{
|
|
{
|
|
@@ -483,12 +483,6 @@ class AttributeInteger extends AttributeDBField
|
|
assert(is_numeric($value));
|
|
assert(is_numeric($value));
|
|
return $value; // supposed to be an int
|
|
return $value; // supposed to be an int
|
|
}
|
|
}
|
|
- public function SQLToScalar($value)
|
|
|
|
- {
|
|
|
|
- // Use cast (int) or intval() ?
|
|
|
|
- return (int)$value;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -525,11 +519,6 @@ class AttributeBoolean extends AttributeInteger
|
|
if ($value) return 1;
|
|
if ($value) return 1;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
- public function SQLToScalar($value)
|
|
|
|
- {
|
|
|
|
- // Use cast (int) or intval() ?
|
|
|
|
- return (int)$value;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -610,10 +599,6 @@ class AttributeString extends AttributeDBField
|
|
}
|
|
}
|
|
return $value;
|
|
return $value;
|
|
}
|
|
}
|
|
- public function SQLToScalar($value)
|
|
|
|
- {
|
|
|
|
- return $value;
|
|
|
|
- }
|
|
|
|
|
|
|
|
public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"')
|
|
public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"')
|
|
{
|
|
{
|
|
@@ -986,10 +971,6 @@ class AttributeDate extends AttributeDBField
|
|
}
|
|
}
|
|
return $value;
|
|
return $value;
|
|
}
|
|
}
|
|
- public function SQLToScalar($value)
|
|
|
|
- {
|
|
|
|
- return $value;
|
|
|
|
- }
|
|
|
|
|
|
|
|
public function GetAsHTML($value)
|
|
public function GetAsHTML($value)
|
|
{
|
|
{
|
|
@@ -1047,6 +1028,7 @@ class AttributeExternalKey extends AttributeDBFieldVoid
|
|
|
|
|
|
public function GetDefaultValue() {return 0;}
|
|
public function GetDefaultValue() {return 0;}
|
|
public function IsNullAllowed() {return $this->Get("is_null_allowed");}
|
|
public function IsNullAllowed() {return $this->Get("is_null_allowed");}
|
|
|
|
+ public function GetNullValue() {return 0;}
|
|
|
|
|
|
public function GetBasicFilterOperators()
|
|
public function GetBasicFilterOperators()
|
|
{
|
|
{
|
|
@@ -1093,6 +1075,11 @@ class AttributeExternalKey extends AttributeDBFieldVoid
|
|
{
|
|
{
|
|
return $this->Get("on_target_delete");
|
|
return $this->Get("on_target_delete");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function MakeRealValue($proposedValue)
|
|
|
|
+ {
|
|
|
|
+ return (int)$proposedValue;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1226,11 +1213,6 @@ class AttributeExternalField extends AttributeDefinition
|
|
$oExtAttDef = $this->GetExtAttDef();
|
|
$oExtAttDef = $this->GetExtAttDef();
|
|
return $oExtAttDef->ScalarToSQL($value);
|
|
return $oExtAttDef->ScalarToSQL($value);
|
|
}
|
|
}
|
|
- public function SQLToScalar($value)
|
|
|
|
- {
|
|
|
|
- $oExtAttDef = $this->GetExtAttDef();
|
|
|
|
- return $oExtAttDef->SQLToScalar($value);
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
// Do not overload GetSQLExpression here because this is handled in the joins
|
|
// Do not overload GetSQLExpression here because this is handled in the joins
|