class ReverseDomainNaturalSorting (View source)

Class ReverseDomainNaturalSorting

Provides specialized natural sorting functionality for reverse DNS domains with support for MySQL, PostgreSQL and SQLite.

This class specifically handles the special case of reverse domain sorting, ensuring IP addresses in reverse notation are sorted properly.

Methods

string
getNaturalSortOrder(string $field, string $dbType, string $direction = 'ASC')

Get the natural sort order SQL clause for reverse DNS domains based on the database type.

Details

string getNaturalSortOrder(string $field, string $dbType, string $direction = 'ASC')

Get the natural sort order SQL clause for reverse DNS domains based on the database type.

Parameters

string $field

The full field name to sort (e.g., "table.name")

string $dbType

The database type ('mysql', 'mysqli', 'pgsql', 'sqlite')

string $direction

Sort direction ('ASC' or 'DESC')

Return Value

string

SQL ORDER BY clause for reverse domain natural sorting