Elgg\Database::fingerprintCallback PHP 메소드

fingerprintCallback() 공개 메소드

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.
부터: 1.9.4
public fingerprintCallback ( callable $callback ) : string
$callback callable The callable value to fingerprint
리턴 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 "";
    }