mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
#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:
@@ -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().'`)');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user