当前位置: 首页>>代码示例>>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;未经允许,请勿转载。