本文整理汇总了PHP中fORM::callReflectCallbacks方法的典型用法代码示例。如果您正苦于以下问题:PHP fORM::callReflectCallbacks方法的具体用法?PHP fORM::callReflectCallbacks怎么用?PHP fORM::callReflectCallbacks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fORM
的用法示例。
在下文中一共展示了fORM::callReflectCallbacks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reflect
//.........这里部分代码省略.........
if (in_array($column_info['type'], array('varchar', 'char', 'text'))) {
$signature .= '$create_links_and_line_breaks=FALSE';
}
$signature .= ')';
$signatures[$prepare_method] = $signature;
// The inspect method
$signature = '';
if ($include_doc_comments) {
$signature .= "/**\n";
$signature .= " * Returns metadata about " . $column . "\n";
$signature .= " * \n";
$elements = array('type', 'not_null', 'default', 'comment');
if (in_array($column_info['type'], array('varchar', 'char', 'text'))) {
$elements[] = 'valid_values';
$elements[] = 'max_length';
}
if ($column_info['type'] == 'float') {
$elements[] = 'decimal_places';
}
if ($column_info['type'] == 'integer') {
$elements[] = 'auto_increment';
$elements[] = 'min_value';
$elements[] = 'max_value';
}
$signature .= " * @param string \$element The element to return. Must be one of: '" . join("', '", $elements) . "'.\n";
$signature .= " * @return mixed The metadata array or a single element\n";
$signature .= " */\n";
}
$inspect_method = 'inspect' . $camelized_column;
$signature .= 'public function ' . $inspect_method . '($element=NULL)';
$signatures[$inspect_method] = $signature;
}
fORMRelated::reflect($class, $signatures, $include_doc_comments);
fORM::callReflectCallbacks($class, $signatures, $include_doc_comments);
$reflection = new ReflectionClass($class);
$methods = $reflection->getMethods();
foreach ($methods as $method) {
$signature = '';
if (!$method->isPublic() || $method->getName() == '__call') {
continue;
}
if ($method->isFinal()) {
$signature .= 'final ';
}
if ($method->isAbstract()) {
$signature .= 'abstract ';
}
if ($method->isStatic()) {
$signature .= 'static ';
}
$signature .= 'public function ';
if ($method->returnsReference()) {
$signature .= '&';
}
$signature .= $method->getName();
$signature .= '(';
$parameters = $method->getParameters();
foreach ($parameters as $parameter) {
if (substr($signature, -1) == '(') {
$signature .= '';
} else {
$signature .= ', ';
}
if ($parameter->isArray()) {
$signature .= 'array ';
}