本文整理匯總了PHP中Fields::getFields_static方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fields::getFields_static方法的具體用法?PHP Fields::getFields_static怎麽用?PHP Fields::getFields_static使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Fields
的用法示例。
在下文中一共展示了Fields::getFields_static方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DropViewSQL
private function DropViewSQL($_name, $_dict = '')
{
if (empty($_dict)) {
$_dict = $this->setDictionarySchema();
}
// DropViewSQL not yet implemented
// return $dict->DropViewSQL($this->getViewname($_name));
$viewname = $this->getViewname($_name, $_dict);
$cols = Fields::getFields_static($viewname);
if (empty($cols)) {
return array();
}
return array('drop view ' . $viewname);
}
示例2: getFields
public static function getFields($tablename, $cache_results = TRUE)
{
$cached_fields = FALSE;
$cache_id = array('table_fields', $tablename);
// we might not want to hit the cache
if (MEMCACHED_ENABLED && $cache_results === TRUE) {
// instanciate the cache and get the cache value
$cache = Cache::Instance();
$cached_fields = $cache->get($cache_id);
}
// go and fetch the data and populate the cache
if ($cached_fields === FALSE) {
$fields = Fields::getFields_static($tablename);
$return = array();
if (is_array($fields)) {
foreach ($fields as $field) {
$return[$field->name] = clone $field;
}
} else {
$return = FALSE;
}
if (MEMCACHED_ENABLED && $return !== FALSE && $cache_results === TRUE) {
$cache->add($cache_id, $return);
}
} else {
$return = $cached_fields;
}
return $return;
}