Nette\Utils\ObjectMixin::getMethods PHP Method

getMethods() public static method

Returns array of public (static, non-static and magic) methods.
public static getMethods ( $class ) : array
return array
    public static function &getMethods($class)
    {
        static $cache;
        if (!isset($cache[$class])) {
            $cache[$class] = array_fill_keys(get_class_methods($class), 0) + self::getMagicMethods($class);
            if ($parent = get_parent_class($class)) {
                $cache[$class] += self::getMethods($parent);
            }
        }
        return $cache[$class];
    }

Usage Example

Example #1
0
 /**
  * @return bool
  */
 public function __isset($name)
 {
     $uname = ucfirst($name);
     return ObjectMixin::getMagicProperty(get_class($this), $name) || $name !== '' && ($methods = ObjectMixin::getMethods(get_class($this))) && (isset($methods['get' . $uname]) || isset($methods['is' . $uname]));
 }