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


PHP JTable::reorder方法代码示例

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


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

示例1: testReorder

 /**
  * Test the reorder method.
  *
  * @return  void
  *
  * @since   12.3
  */
 public function testReorder()
 {
     $this->object->load(array('id1' => 25, 'id2' => 51));
     $this->object->ordering = 25;
     $this->object->store();
     $object2 = new TableDbTestComposite(TestCaseDatabase::$driver);
     $object2->load(array('id1' => 25, 'id2' => 51));
     $this->assertEquals(25, $object2->ordering, 'Preconditions');
     $this->object->reorder();
     $object2->load(array('id1' => 25, 'id2' => 51));
     $this->assertEquals(2, $object2->ordering, 'Elements did not get reordered');
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:19,代码来源:JTableTest.php

示例2: reorder

 function reorder($where = '')
 {
     parent::reorder('option_id = ' . $this->_db->Quote($this->option_id));
 }
开发者ID:A-Bush,项目名称:pprod,代码行数:4,代码来源:optionvalues.php

示例3: prepareTable

 /**
  * Prepare and sanitise the table data prior to saving.
  *
  * @param   JTable  $table  A JTable object.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function prepareTable($table)
 {
     // Set the publish date to now
     $db = $this->getDbo();
     if ($table->state == 1 && (int) $table->publish_up == 0) {
         $table->publish_up = JFactory::getDate()->toSql();
     }
     if ($table->state == 1 && intval($table->publish_down) == 0) {
         $table->publish_down = $db->getNullDate();
     }
     // Increment the content version number.
     $table->version++;
     // Reorder the articles within the category so the new article is first
     if (empty($table->id)) {
         $table->reorder('catid = ' . (int) $table->catid . ' AND state >= 0');
     }
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:26,代码来源:article.php

示例4: setOrderPosition

 /**
  * Method to set new item ordering as first or last.
  * 
  * @param   JTable  $table      Item table to save.
  * @param   string  $position   'first' or other are last.
  *
  * @return  type    
  */
 public function setOrderPosition($table, $position = null)
 {
     if ($position == 'first') {
         if (!$table->ordering) {
             $table->reorder('catid = ' . (int) $table->catid . ' AND published >= 0');
         }
     } else {
         // Set ordering to the last item if not set
         if (empty($table->ordering)) {
             $db = JFactory::getDbo();
             $db->setQuery('SELECT MAX(ordering) FROM #__' . $this->component . '_' . $this->list_name);
             $max = $db->loadResult();
             $table->ordering = $max + 1;
         }
     }
 }
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:24,代码来源:modeladmin.php

示例5: reorder

 function reorder()
 {
     parent::reorder('product_id = ' . $this->_db->Quote($this->product_id));
 }
开发者ID:A-Bush,项目名称:pprod,代码行数:4,代码来源:productfiles.php

示例6: prepareTable

 /**
  * Prepare and sanitise the table data prior to saving.
  *
  * @param   JTable  $table  A JTable object.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function prepareTable($table)
 {
     // Reorder the articles within the category so the new article is first
     if (empty($table->id)) {
         $table->reorder('enabled >= 1');
     }
 }
开发者ID:compojoom,项目名称:lib_compojoom,代码行数:16,代码来源:customfield.php


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