Elgg\Database::fingerprintCallback PHP Method

fingerprintCallback() public method

This is used to cache queries whose results were transformed by the callback. If the callback involves object method calls of the same class, different instances will return different values.
Since: 1.9.4
public fingerprintCallback ( callable $callback ) : string
$callback callable The callable value to fingerprint
return string A string that is unique for each callable passed in
    public function fingerprintCallback($callback)
    {
        if (is_string($callback)) {
            return $callback;
        }
        if (is_object($callback)) {
            return spl_object_hash($callback) . "::__invoke";
        }
        if (is_array($callback)) {
            if (is_string($callback[0])) {
                return "{$callback[0]}::{$callback[1]}";
            }
            return spl_object_hash($callback[0]) . "::{$callback[1]}";
        }
        // this should not happen
        return "";
    }