本文整理汇总了PHP中KObject::getMethods方法的典型用法代码示例。如果您正苦于以下问题:PHP KObject::getMethods方法的具体用法?PHP KObject::getMethods怎么用?PHP KObject::getMethods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KObject
的用法示例。
在下文中一共展示了KObject::getMethods方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMethods
/**
* Get a list of all the available methods
*
* This function returns an array of all the methods, both native and mixed.
* It will also return the methods exposed by the decorated object.
*
* @return array An array
*/
public function getMethods()
{
if (!$this->__methods) {
$methods = array();
$object = $this->getObject();
if (!$object instanceof KObject) {
$reflection = new ReflectionClass($object);
foreach ($reflection->getMethods() as $method) {
$methods[] = $method->name;
}
} else {
$methods = $object->getMethods();
}
$this->__methods = array_merge(parent::getMethods(), $methods);
}
return $this->__methods;
}
示例2: getMethods
/**
* Return an array of methods.
*
* (non-PHPdoc)
* @see KObject::getMethods()
*/
public function getMethods()
{
$behaviors = $this->getRepository()->getBehaviors();
foreach ($behaviors as $behavior) {
$this->mixin($behavior);
}
return parent::getMethods();
}