本文整理汇总了PHP中ClassInfo::has_method_from方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassInfo::has_method_from方法的具体用法?PHP ClassInfo::has_method_from怎么用?PHP ClassInfo::has_method_from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassInfo
的用法示例。
在下文中一共展示了ClassInfo::has_method_from方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isEndofLine
/**
* Version viewer must only be added at if this is the final getCMSFields for a class.
* in order to avoid having to rename all fields from eg Root.Main to Root.Current.Main
* To do this we test if getCMSFields is from the current class
*/
public function isEndofLine($className)
{
$methodFromClass = ClassInfo::has_method_from($this->ClassName, 'getCMSFields', $className);
if ($methodFromClass) {
return true;
}
}
示例2: get_extra_config_sources
public static function get_extra_config_sources($class = null)
{
if ($class === null) {
$class = get_called_class();
}
// If this class is unextendable, NOP
if (in_array($class, self::$unextendable_classes)) {
return;
}
// Variable to hold sources in
$sources = null;
// Get a list of extensions
$extensions = Config::inst()->get($class, 'extensions', Config::UNINHERITED | Config::EXCLUDE_EXTRA_SOURCES);
if ($extensions) {
// Build a list of all sources;
$sources = array();
foreach ($extensions as $extension) {
list($extensionClass, $extensionArgs) = self::parse_class_spec($extension);
$sources[] = $extensionClass;
if (!ClassInfo::has_method_from($extensionClass, 'add_to_class', 'Extension')) {
Deprecation::notice('4.0', "add_to_class deprecated on {$extensionClass}. Use get_extra_config instead");
}
call_user_func(array($extensionClass, 'add_to_class'), $class, $extensionClass, $extensionArgs);
foreach (array_reverse(ClassInfo::ancestry($extensionClass)) as $extensionClassParent) {
if (ClassInfo::has_method_from($extensionClassParent, 'get_extra_config', $extensionClassParent)) {
$extras = $extensionClassParent::get_extra_config($class, $extensionClass, $extensionArgs);
if ($extras) {
$sources[] = $extras;
}
}
}
}
}
return $sources;
}