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


PHP SearchHandler::extractPaging方法代码示例

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


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

示例1: _new

 public function _new()
 {
     parent::_new();
     // For new actions the stitem_id and from_uom_id will be set
     // For edit actions, the id will be set pointing to the uom conversion to be edited
     if ($this->_data['action'] == 'edit') {
         $stuom = $this->_uses[$this->modeltype];
         $stitem_id = $stuom->stitem_id;
         $stitem_uom_id = $stuom->from_uom_id;
         $stitem_uom_name = $stuom->from_uom_name;
     } else {
         $stitem = new STitem();
         $stitem->load($this->_data['stitem_id']);
         $stitem_id = $stitem->id;
         $stitem_uom_id = $stitem->uom_id;
         $stitem_uom_name = $stitem->uom_name;
     }
     $this->view->set('stitem_id', $stitem_id);
     $this->view->set('stitem_uom_id', $stitem_uom_id);
     $this->view->set('stitem_uom_name', $stitem_uom_name);
     $this->view->set('stitem', Stuomconversion::getStockItem($stitem_id));
     $elements = new STuomconversionCollection(new STuomconversion());
     $sh = new SearchHandler($elements, false);
     $sh->extract();
     $sh->addConstraint(new Constraint('stitem_id', '=', $stitem_id));
     $sh->setOrderBy('from_uom_name');
     $sh->extractOrdering();
     $sh->extractPaging();
     $elements->load($sh);
     $this->view->set('elements', $elements);
     $this->view->set('no_ordering', true);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:StuomconversionsController.php

示例2: view

 public function view()
 {
     if (!$this->loadData()) {
         $this->dataError();
         sendBack();
     }
     $transaction = $this->_uses[$this->modeltype];
     $id = $transaction->id;
     $this->view->set('transaction', $transaction);
     $elements = new WHTransferruleCollection(new WHTransferrule());
     $sh = new SearchHandler($elements, false);
     $sh->extract();
     $sh->addConstraint(new Constraint('whaction_id', '=', $id));
     $sh->extractOrdering();
     $sh->extractPaging();
     $elements->load($sh);
     $this->view->set('elements', $elements);
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Show', array('all' => array('tag' => 'All Actions', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'index'))), 'locations' => array('tag' => 'All Stores', 'link' => array_merge($this->_modules, array('controller' => 'WHStores', 'action' => 'index')))));
     $sidebarlist = array();
     $sidebarlist['edit'] = array('tag' => 'Edit', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'edit', 'id' => $id)));
     $sidebarlist['delete'] = array('tag' => 'Delete', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'delete', 'id' => $id)));
     if (is_null($transaction->max_rules) || $elements->count() < $transaction->max_rules) {
         $sidebarlist['Add'] = array('tag' => 'Add Rule', 'link' => array_merge($this->_modules, array('controller' => 'WHTransferrules', 'action' => 'new', 'whaction_id' => $id)));
     }
     $sidebar->addList('This Action', $sidebarlist);
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
     $this->view->set('clickaction', 'view');
     $this->view->set('clickcontroller', 'WHTransferrules');
     $this->view->set('no_ordering', true);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:WhactionsController.php

示例3: fillCollection

 /**
  * fills a collection of the specified model type with the fields specified,
  * also gives correct click controller, action and edit handlers so
  * that smarty datatable will work correctly.
  * finally outputs specified smarty variable as the collection for
  * datatable to use
  * used for alternate controller to display specific contents of a different
  * controller
  */
 public function fillCollection($modelname, $fields, $constraints, $clickcontroller, $clickaction, $editclickaction, $deletecontroller, $smartyname, $tablename = null, $deleteaction = null, $newtext = null, $limit = null, $orderdir = null, $offset = null)
 {
     $collectionname = $modelname . 'Collection';
     $collection = new $collectionname();
     $sh = new SearchHandler($collection);
     $sh->fields = $fields;
     $sh->constraints = $constraints;
     $sh->extractOrdering();
     $sh->extractPaging();
     $sh->perpage = 900000;
     if (isset($orderdir)) {
         $sh->orderdir = $orderdir;
     }
     if (isset($limit) && isset($offset)) {
         $sh->setLimit($limit, $offset);
     }
     if (isset($tablename)) {
         $collection->_tablename = $tablename;
     }
     $collection->load($sh);
     $collection->clickcontroller = $clickcontroller;
     $collection->clickaction = $clickaction;
     $collection->editclickaction = $editclickaction;
     $collection->deletecontroller = $deletecontroller;
     if (isset($deleteaction)) {
         $collection->deleteclickaction = $deleteaction;
     }
     if (isset($newtext)) {
         $collection->newtext = $newtext;
     }
     $this->view->set($smartyname, $collection);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:41,代码来源:Controller.php

示例4: showFulfilled

 public function showFulfilled()
 {
     $mfworkorders = new MFWorkorderCollection($this->_templateobject);
     $sh = new SearchHandler($mfworkorders);
     $sh->extract();
     $sh->addConstraint(new Constraint('status', '=', 'O'));
     $sh->addConstraint(new Constraint('made_qty', '>=', '(order_qty)'));
     $sh->extractOrdering();
     $sh->extractPaging();
     $mfworkorders->load($sh);
     $this->view->set('clickaction', 'view');
     $this->view->set('mfworkorders', $mfworkorders);
     $sidebar = new SidebarController($this->view);
     $sidebarlist = array();
     $sidebarlist['viewAll'] = array('tag' => 'View', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'index'));
     $sidebar->addList('All Works Orders', $sidebarlist);
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:19,代码来源:MfworkordersController.php


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