本文整理汇总了PHP中Method::setConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP Method::setConnection方法的具体用法?PHP Method::setConnection怎么用?PHP Method::setConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Method
的用法示例。
在下文中一共展示了Method::setConnection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Method
public function &updateClassDetails(&$File, &$Component, &$SourceAnalyzer)
{
$MethodInstance = new Method(array('init' => false));
$MethodInstance->setConnection($this->getConnection());
$MethodInstance->init();
$parsed_details = $SourceAnalyzer->getParsedArray($File->body);
$available_classes = empty($parsed_details['classes']) ? array() : array_keys($parsed_details['classes']);
if (empty($available_classes)) {
return $available_classes;
}
$Classes = array();
foreach ($available_classes as $class_name) {
$extends = !empty($parsed_details['classes'][$class_name]['extends']) ? $parsed_details['classes'][$class_name]['extends'] : false;
if ($extends) {
$SourceAnalyzer->log('Looking for parent class: ' . $extends);
$ParentClass = $this->_addOrUpdateClassDetails($extends, $File, $Component, $SourceAnalyzer, array(), true);
}
$Class = $this->_addOrUpdateClassDetails($class_name, $File, $Component, $SourceAnalyzer, $parsed_details['classes'][$class_name]);
if (!empty($ParentClass)) {
$SourceAnalyzer->log('Setting ' . $extends . ' as the parent of ' . $class_name);
$ParentClass->tree->addChild($Class);
$ParentClass->save();
}
$Class->methods = array();
if (!empty($parsed_details['classes'][$class_name]['methods'])) {
foreach ($parsed_details['classes'][$class_name]['methods'] as $method_name => $method_details) {
$Class->methods[] = $MethodInstance->updateMethodDetails($Class, $method_name, $method_details, $SourceAnalyzer);
}
}
$Classes[] = $Class;
}
return $Classes;
}