LdapTools\Query\LdapResultSorter::convertValueToString PHP Method

convertValueToString() protected method

Certain cases may require the value to be specifically changed to a string, as not every object has default string representation. The most common wanting to be sorted would likely be a DateTime object.
protected convertValueToString ( mixed $value ) : string
$value mixed
return string
    protected function convertValueToString($value)
    {
        if ($value instanceof \DateTime) {
            $value = $value->getTimestamp();
        }
        return (string) $value;
    }