当前位置: 首页>>代码示例>>PHP>>正文


PHP aql::get_aql方法代码示例

本文整理汇总了PHP中aql::get_aql方法的典型用法代码示例。如果您正苦于以下问题:PHP aql::get_aql方法的具体用法?PHP aql::get_aql怎么用?PHP aql::get_aql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aql的用法示例。


在下文中一共展示了aql::get_aql方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getList

 /**
  * returns an array of ids
  * @param   array   $clause             clause array
  * @param   Boolean $do_count           if true, returns a count of the list
  * @return  array
  * @throws  \Exception                  if this is not a subclasss
  */
 public static function getList($clause = array(), $do_count = false)
 {
     $model_name = self::getCalledClass();
     if (!$model_name || $model_name == 'Model') {
         throw new Exception('Cannot use getList on a non subclass of Model.');
     }
     $fn = \getList::getFn(\aql::get_aql($model_name));
     return $fn($clause, $do_count);
 }
开发者ID:HotwireCommunications,项目名称:skyphp,代码行数:16,代码来源:class.Model.php

示例2: get

 /**
  * Fetches the aql array by name or creates it and stores it
  * @param   string  $model
  * @param   string  $aql
  * @return  array
  */
 public static function get($model, $aql = null)
 {
     if (!$model || $model == 'model') {
         return array();
     }
     if (self::$aqlArrays[$model]) {
         return self::$aqlArrays[$model];
     } else {
         if (!$aql) {
             if (self::$aqls[$model]) {
                 $aql = self::$aqls[$model];
             } else {
                 $aql = self::$aqls[$model] = aql::get_aql($model);
             }
         }
         return self::$aqlArrays[$model] = aql2array($aql);
     }
 }
开发者ID:HotwireCommunications,项目名称:skyphp,代码行数:24,代码来源:class.aql2array.php

示例3: array

    case 'h1':
        $title = 'h1';
        $where[] = "field = 'h1'";
        break;
    case 'h1_blurb':
        $title = 'h1_blurb';
        $where[] = "field = 'h1_blurb'";
        break;
    case 'meta_description':
        $title = 'meta_description';
        $where[] = "field = 'meta_description'";
        break;
    default:
        // tab_redirect() ensures this is never the case
        break;
}
$title = "Website Page Data";
template::inc('intranet', 'top');
?>

<?php 
snippet::tabs($tabs);
$aql = aql::get_aql('website_page_data');
$cols = "\n\t\t\tnickname {label: Nickname;}\n\t\t\tfield {label: field;}\n\t\t\tvalue {label: value;}\t\t\n\t";
$clause = array('website' => array('where' => $where, 'order by' => $order_by));
$options = array('enable_sort' => true);
?>
	
<?php 
aql::grid($aql, $cols, $clause, $options);
template::inc('intranet', 'bottom');
开发者ID:hshoghi,项目名称:cms,代码行数:31,代码来源:website-page-data-listing.php

示例4: collection

function collection($model, $clause, $duration = null)
{
    $key = "aql:get:{$model}:" . substr(md5(serialize($clause)), 0, 250);
    $collection = mem($key);
    if (!$collection) {
        $aql = aql::get_aql($model);
        // make minimal sql
        $aql_array = aql2array($aql);
        foreach ($aql_array as $i => $block) {
            unset($aql_array[$i]['objects']);
            unset($aql_array[$i]['fields']);
            unset($aql_array[$i]['subqueries']);
        }
        $sql_array = aql::make_sql_array($aql_array, aql::check_clause_array($aql_array, $clause));
        $minimal_sql = $sql_array['sql'];
        $r = sql($minimal_sql);
        $collection = array();
        while (!$r->EOF) {
            $collection[] = $r->Fields(0);
            $r->MoveNext();
        }
        #print_a($collection);
        mem($key, $collection, $duration);
    }
    if (is_array($collection)) {
        //print_a($collection);
        foreach ($collection as $id) {
            $obj = Model::get($model, $id);
            $ret[] = $obj->dataToArray();
        }
        return $ret;
    } else {
        return false;
    }
}
开发者ID:HotwireCommunications,项目名称:skyphp,代码行数:35,代码来源:functions.inc.php

示例5: checkProfile

 private function checkProfile($piece, $i, $file, $path)
 {
     // find primary_table via model if it is specified
     if ($this->settings['model']) {
         $aql = \aql::get_aql($this->settings['model']);
         $this->settings['primary_table'] = \aql::get_primary_table($aql);
     }
     // throw error if no primary_table
     if (!$this->settings['primary_table']) {
         header("HTTP/1.1 503 Service Temporarily Unavailable");
         header("Status: 503 Service Temporarily Unavailable");
         header("Retry-After: 1");
         throw new \Exception('Profile Page Error: $primary_table not specified on file. <br />' . $file);
         return false;
     }
     // set to profile
     $decrypted = \decrypt($piece, $this->settings['primary_table']);
     if ($piece == 'add-new' || is_numeric($decrypted)) {
         $this->addToPageAndPath($file, $path, $i);
         return true;
     }
     return false;
 }
开发者ID:HotwireCommunications,项目名称:skyphp,代码行数:23,代码来源:PageRouter.php


注:本文中的aql::get_aql方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。