#421 Sort IP addresses on INET_ATON (API only, see #520 to have this as the default sort order for NW Interfaces)

SVN:trunk[1897]
This commit is contained in:
Romain Quetiez
2012-03-19 08:28:04 +00:00
parent 18b234c200
commit 619ce5f130
3 changed files with 28 additions and 4 deletions

View File

@@ -318,6 +318,12 @@ abstract class AttributeDefinition
public function GetSQLValues($value) {return array();} // returns column/value pairs (1 in most of the cases), for WRITING (Insert, Update)
public function RequiresIndex() {return false;}
public function GetOrderBySQLExpressions($sClassAlias)
{
// Note: This is the responsibility of this function to place backticks around column aliases
return array('`'.$sClassAlias.$this->GetCode().'`');
}
// Import - differs slightly from SQL input, but identical in most cases
//
public function GetImportColumns() {return $this->GetSQLColumns();}
@@ -1899,6 +1905,12 @@ class AttributeIPAddress extends AttributeString
$sNum = '(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])';
return "^($sNum\\.$sNum\\.$sNum\\.$sNum)$";
}
public function GetOrderBySQLExpressions($sClassAlias)
{
// Note: This is the responsibility of this function to place backticks around column aliases
return array('INET_ATON(`'.$sClassAlias.$this->GetCode().'`)');
}
}
/**