當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataModel::getContent方法代碼示例

本文整理匯總了PHP中DataModel::getContent方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataModel::getContent方法的具體用法?PHP DataModel::getContent怎麽用?PHP DataModel::getContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DataModel的用法示例。


在下文中一共展示了DataModel::getContent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPagesDetailsZoom

 function getPagesDetailsZoom($categoryAsked = '')
 {
     $this->objects['category'] = new ArchiveTable('category');
     $this->objects['page'] = new ArchiveTable('page');
     $this->objects['file'] = new ArchiveTable('file');
     $this->objects['vars_name'] = new ArchiveTable('vars_name');
     $this->objects['vars_value'] = new ArchiveTable('vars_value');
     $nbVis = $this->getContent('nb_vis');
     //		printDebug($all); exit;
     if ($this->archive->periodType === DB_ARCHIVES_PERIOD_DAY) {
         $nbLast = 15;
     } else {
         $nbLast = 3;
     }
     $archives = $this->getLastArchives($nbLast, 1, DATE_NORMAL);
     printTime('beg 1 of pages details');
     $i = 0;
     // load "pure" pages array
     foreach ($archives as $dateToDisplay => $archive) {
         printTime('foreach' . ++$i . ' of pages details');
         $o_data = new DataModel($archive, $this->request);
         $displayInfo[] = $dateToDisplay;
         printTime('before uz' . $i . ' of pages details');
         if (STORE_PAG_ARRAY_IN_FILE) {
             $file = INCLUDE_PATH . "/datas/archives/" . $o_data->infoSerialized['idarchives'] . ".dat";
             if (!is_readable($file)) {
                 saveConfigFile($file, unserialize($o_data->infoSerialized['vis_pag_grp']), 'visPagGrp');
             }
             if (is_readable($file)) {
                 $visPagGrp = array();
                 require_once $file;
                 $array = $visPagGrp;
             }
         } else {
             $visPagGrp = array();
             if (!is_null($o_data->infoSerialized['vis_pag_grp'])) {
                 $visPagGrp = $o_data->getContent('vis_pag_grp');
             }
         }
         //var_dump($visPagGrp);exit;
         $a_all[] = $visPagGrp;
         printTime('after uz' . $i . ' of pages details');
         $headerInfo[] = array('nb_pag' => $o_data->getContent('nb_pag'), 'nb_uniq_pag' => $o_data->getContent('nb_uniq_pag'), 'nb_max_pag' => $o_data->getContent('nb_max_pag'));
         //printDebug($headerInfo);
     }
     printTime('beg 2 of pages details');
     foreach ($a_all as $j => $all) {
         if (empty($categoryAsked)) {
             $a_infosDay[$j] = $all;
             $level = 0;
         } else {
             $categoryAsked = (string) $categoryAsked;
             //print("Zoom cate '$categoryAsked' <br>");
             //print($categoryAsked[2]);
             $detailsCategory = explode(">", $categoryAsked);
             //printDebug($detailsCategory);
             $level = sizeof($detailsCategory);
             //print("level : $level <br>");
             $array = $this->getPagesDetailsZoomArrayLevel($all, $level, $detailsCategory);
             $a_infosDay[$j] = $array;
         }
     }
     printTime('mid of pages details');
     // list asked category
     if ($level != 0) {
         $categoryAsked .= '>';
     }
     //		var_dump($categoryAsked);
     //		var_dump($a_infosDay[0]);
     $return = array();
     if (is_array($a_infosDay[0])) {
         //var_dump($a_infosDay[0]);
         foreach ($a_infosDay[0] as $currentId => $info) {
             // page or file or category, but not total
             if ($currentId != 'p_pmv_sum' && $currentId != 'f_pmv_sum') {
                 $id = '';
                 $parentId = '';
                 $data = '';
                 $sum = 0;
                 $sumN1 = 0;
                 $sumN2 = 0;
                 $percentN1 = 0;
                 $percentN2 = 0;
                 $type = '';
                 $entry = 0;
                 $sumtime = 0;
                 $exit = 0;
                 $singlepage = 0;
                 $a_vars = array();
                 // category
                 if (substr($currentId, 0, 1) === 'c') {
                     $type = 'category';
                     $entry = @$info['p_pmv_sum'][ARRAY_INDEX_ENTRYPAGE];
                     $exit = @$info['p_pmv_sum'][ARRAY_INDEX_EXITPAGE];
                     $sum = @$info['p_pmv_sum'][ARRAY_INDEX_COUNT] + @$info['f_pmv_sum'][ARRAY_INDEX_COUNT];
                     $sumtime = @$info['p_pmv_sum'][ARRAY_INDEX_TIME_TOTAL];
                     $singlepage = @$info['p_pmv_sum'][ARRAY_INDEX_PAGES_VISIT_ONEPAGE];
                     $allInfoInGroup = $this->getPagesDetailsZoomArrayLevel($a_infosDay[0], 1, array($currentId));
                     //var_dump($allInfoInGroup);exit;
                     //$a_vars = $this->getVarIdToName($a_infosDay[0]['p_pmv_sum'][ARRAY_INDEX_VARS]);
//.........這裏部分代碼省略.........
開發者ID:ber5ien,項目名稱:www.jade-palace.co.uk,代碼行數:101,代碼來源:DataModel.class.php


注:本文中的DataModel::getContent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。