Elgg\HooksRegistrationService::unregisterHandler PHP Метод

unregisterHandler() публичный Метод

Unregister a handler
public unregisterHandler ( string $name, string $type, callable $callback ) : boolean
$name string
$type string
$callback callable
Результат boolean
    public function unregisterHandler($name, $type, $callback)
    {
        if (($name == 'view' || $name == 'view_vars') && $type != 'all') {
            $type = _elgg_services()->views->canonicalizeViewName($type);
        }
        if (empty($this->registrations[$name][$type])) {
            return false;
        }
        $matcher = $this->getMatcher($callback);
        foreach ($this->registrations[$name][$type] as $i => $registration) {
            if ($matcher) {
                if (!$matcher->matches($registration[self::REG_KEY_HANDLER])) {
                    continue;
                }
            } else {
                if ($registration[self::REG_KEY_HANDLER] != $callback) {
                    continue;
                }
            }
            unset($this->registrations[$name][$type][$i]);
            return true;
        }
        return false;
    }