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


PHP I2CE_FormStorage::setLastListCount方法代碼示例

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


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

示例1: queryLastListCount

 /**
  * Query the last list count and set it in FormStorage
  * @param string $form The form name to set.
  */
 protected function queryLastListCount($form)
 {
     $num_rows = $this->db->queryRow("SELECT FOUND_ROWS() AS num_rows");
     if (!I2CE::pearError($num_rows, "Couldn't get total number of results.")) {
         I2CE_FormStorage::setLastListCount($form, (int) $num_rows->num_rows);
     }
 }
開發者ID:apelon-ohie,項目名稱:ihris-site,代碼行數:11,代碼來源:I2CE_FormStorage_DB.php

示例2: listDisplayFields


//.........這裏部分代碼省略.........
                     if ($field == 'parent') {
                         $data['parent'] = null;
                         $form_config->setIfIsSet($data['parent'], 'parent');
                     } else {
                         if ($field == 'last_modified') {
                             $data['last_modified'] = date("Y-m-d H:i:s", 0);
                             $form_config->setIfIsSet($data['last_modified'], 'last_modified');
                         } else {
                             $data[$field] = null;
                             $form_config->setIfIsSet($data[$field], "fields/{$field}");
                         }
                     }
                 }
             }
             if ($func && $func($data) !== true) {
                 continue;
             }
             foreach ($new_fields as $field) {
                 unset($data[$field]);
             }
             if ($parent === true) {
                 $data['parent'] = 0;
                 $form_config->setIfIsSet($data['parent'], 'parent');
             }
             $vals[$id] = $data;
         }
     } else {
         foreach ($forms as $id => $form_config) {
             if (!$form_config instanceof I2CE_MagicDataNode) {
                 continue;
             }
             if ($mod_time && $form_config->is_scalar('last_modified') && $mod_time->before(I2CE_Date::now(I2CE_Date::DATE_TIME, $form_config->last_modified))) {
                 continue;
             }
             $data = array();
             $displays = array();
             foreach ($all_fields as $field) {
                 if ($field == "id") {
                     $data[$field] = $id;
                 } else {
                     if ($field == 'parent') {
                         $data['parent'] = null;
                         $form_config->setIfIsSet($data['parent'], 'parent');
                     } else {
                         if ($field == 'last_modified') {
                             $data['last_modified'] = date("Y-m-d H:i:s", 0);
                             $form_config->setIfIsSet($data['last_modified'], 'last_modified');
                         } else {
                             $fieldObj = $formObj->getField($field);
                             $data[$field] = null;
                             if ($fieldObj instanceof I2CE_FormField && $form_config->setIfIsSet($dbval, "fields/{$field}")) {
                                 $fieldObj->setFromDB($dbval);
                                 $data[$field] = $dbval;
                                 $displays[$field] = $fieldObj->getDisplayValue();
                             } else {
                                 $data[$field] = null;
                             }
                         }
                     }
                 }
             }
             if ($func && $func($data) !== true) {
                 continue;
             }
             if ($parent === true) {
                 $data['parent'] = 0;
                 $form_config->setIfIsSet($data['parent'], 'parent');
             }
             foreach ($displays as $field => $disp) {
                 $data[$field] = $disp;
             }
             $vals[$id] = $data;
         }
         if ($order_func) {
             uasort($vals, $order_func);
         }
         if (count($new_fields) > 0) {
             foreach ($vals as &$data) {
                 foreach ($new_fields as $field) {
                     unset($data[$field]);
                 }
             }
         }
     }
     I2CE_FormStorage::setLastListCount($form, count($vals));
     if ($limit === true) {
         return array_slice($vals, 0, 1);
     } else {
         if (is_numeric($limit)) {
             return array_slice($vals, 0, $limit);
         } else {
             if (is_array($limit)) {
                 list($offset, $limit) = $limit;
                 return array_slice($vals, $offset, $limit);
             } else {
                 return $vals;
             }
         }
     }
 }
開發者ID:apelon-ohie,項目名稱:ihris-site,代碼行數:101,代碼來源:I2CE_FormStorage_magicdata.no_db.php


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