Prado\Web\UI\TTemplate::isClassBehaviorMethod PHP Метод

isClassBehaviorMethod() защищенный Метод

Checks if the given method belongs to a previously attached class behavior.
protected isClassBehaviorMethod ( ReflectionClass $class, string $method ) : boolean
$class ReflectionClass
$method string
Результат boolean
    protected function isClassBehaviorMethod(ReflectionClass $class, $method)
    {
        $component = new ReflectionClass('TComponent');
        $behaviors = $component->getStaticProperties();
        if (!isset($behaviors['_um'])) {
            return false;
        }
        foreach ($behaviors['_um'] as $name => $list) {
            if (strtolower($class->getShortName()) !== $name && !$class->isSubclassOf($name)) {
                continue;
            }
            foreach ($list as $param) {
                if (method_exists($param->getBehavior(), $method)) {
                    return true;
                }
            }
        }
        return false;
    }