本文整理匯總了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 ';
}