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


PHP DataObjectCollection::setParams方法代码示例

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


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

示例1: populate

 function populate()
 {
     $po_obj = new DataObject('po_no_auth_user');
     $po_obj->idField = 'id';
     $po_obj->identifierField = 'order_number';
     $po_col = new DataObjectCollection($po_obj);
     $po_col->setParams();
     $sh = new SearchHandler($po_col, false);
     $sh->setFields(array('id', 'order_number', 'supplier', 'status'));
     $sh->addConstraint(new Constraint('status', '!=', 'X'));
     $this->setSearchLimit($sh);
     $sh->setOrderby(array('order_date', 'due_date', 'order_number'));
     $po_col->load($sh);
     $this->contents = $po_col;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:15,代码来源:POrdersNoAuthUserEGlet.php

示例2: index

 public function index(DataObjectCollection $collection, $sh = '', &$c_query = null)
 {
     showtime('start-controller-index');
     $collection->setParams();
     if (!$sh instanceof SearchHandler) {
         $sh = $this->setSearchHandler($collection);
     }
     showtime('sh-extracted');
     if (isset($this->search) && !isset($this->_data['orderby']) && !isset($this->_data['page'])) {
         $cc = $this->search->toConstraintChain();
         $sh->addConstraintChain($cc);
         $sh->save();
         // cache the search string
         $search_string_array = array('fop' => $this->search->toString('fop'), 'html' => $this->search->toString('html'));
         $_SESSION['search_strings'][EGS_USERNAME][$sh->search_id] = $search_string_array;
     }
     // Need to set the orderby of the collection in the searchhandler?
     // But if this is set in the collection, seems to take it
     // so why not here?
     showtime('pre-load');
     $collection->load($sh, $c_query);
     $this->view->set('total_records', $collection->total_records);
     $this->view->set('num_records', $collection->num_records);
     $this->view->set('num_pages', $collection->num_pages);
     $this->view->set('cur_page', $collection->cur_page);
     showtime('post-load');
     $this->view->set(strtolower($collection->getModelName()) . 's', $collection);
     if (isset($this->_data['json'])) {
         $this->view->set('echo', $collection->toJSON());
     }
     if ($this->_templateName === false) {
         $this->_templateName = $this->getTemplateName('index');
     }
     showtime('end-controller-index');
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:35,代码来源:Controller.php


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