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


PHP JTable::save方法代码示例

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


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

示例1: testSave

	/**
	 * Tests the save method
	 *
	 * @covers JTable::save
	 *
	 * @return  void
	 *
	 * @since 12.3
	 */
	public function testSave()
	{
		$this->object = $this->getMockBuilder('TableDbTestComposite')
			->setConstructorArgs(array(TestCaseDatabase::$driver))
			->setMethods(array('bind', 'check', 'store', 'checkin', 'reorder', 'setError'))
			->getMock();

		$this->object->expects($this->once())
			->method('bind')
			->with(array('id1' => 75, 'id2' => 75, 'title' => 'My testSave Title'), '')
			->will($this->returnValue(true));

		$this->object->expects($this->once())
			->method('check')
			->with()
			->will($this->returnValue(true));

		$this->object->expects($this->once())
			->method('store')
			->with()
			->will($this->returnValue(true));

		$this->object->expects($this->never())
			->method('reorder');

		$this->object->save(array('id1' => 75, 'id2' => 75, 'title' => 'My testSave Title'));
	}
开发者ID:robschley,项目名称:joomla-platform,代码行数:36,代码来源:JTableTest.php

示例2: save

 /**
  * Method to save Both the Parent Table & Child Table
  * params array
  * return boolean
  * (non-PHPdoc)
  * @see JTable::save()
  */
 public function save($src, $orderingFilter = '', $ignore = '')
 {
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_j2store/tables');
     $status = true;
     if (parent::save($src, $orderingFilter, $ignore)) {
         // after save parent save return primary key value
         // save the table only pk value exists
         if ($this->taxprofile_id) {
             if (isset($src['tax-to-taxrule-row']) && count($src['tax-to-taxrule-row'])) {
                 $trTable = JTable::getInstance('taxrule', 'Table');
                 $status = true;
                 foreach ($src['tax-to-taxrule-row'] as $taxrate) {
                     $taxrate['taxprofile_id'] = $this->taxprofile_id;
                     try {
                         $trTable->save($taxrate);
                     } catch (Exception $e) {
                         $status = false;
                     }
                     if (!$status) {
                         break;
                     }
                 }
             }
         }
     }
     return $status;
 }
开发者ID:ForAEdesWeb,项目名称:AEW4,代码行数:34,代码来源:taxprofile.php

示例3: save

 function save($data)
 {
     if (!parent::save($data)) {
         $this->setError($this->getError());
         return false;
     }
     return true;
 }
开发者ID:A-Bush,项目名称:pprod,代码行数:8,代码来源:ordercoupons.php

示例4: save

 /**
  * Override save method to not create duplicates
  *
  * @param   mixed   $src             An associative array or object to bind to the JTable instance.
  * @param   string  $orderingFilter  Filter for the order updating
  * @param   mixed   $ignore          An optional array or space separated list of properties
  * @return  boolean  True on success.
  **/
 public function save($src, $orderingFilter = '', $ignore = '')
 {
     $this->load($src);
     if ($this->get('id')) {
         $result = true;
     } else {
         $result = parent::save($src, $orderingFilter, $ignore);
     }
     return $result;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:18,代码来源:progress.factors.php

示例5: save

 public function save($src, $orderingFilter = '', $ignore = '')
 {
     $status = true;
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_j2store/tables/');
     if (parent::save($src, $orderingFilter, $ignore)) {
         if ($this->geozone_id) {
             $grtable = JTable::getInstance('geozonerule', 'Table');
             $status = true;
             foreach ($src['zone_to_geo_zone'] as $georule) {
                 $georule['geozone_id'] = $this->geozone_id;
                 try {
                     $grtable->save($georule);
                 } catch (Exception $e) {
                     $status = false;
                 }
                 if (!$status) {
                     break;
                 }
             }
         }
     }
     return $status;
 }
开发者ID:ForAEdesWeb,项目名称:AEW4,代码行数:23,代码来源:geozone.php

示例6: save

 public function save($src, $orderingFilter = '', $ignore = '')
 {
     $status = true;
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_j2store/tables');
     if (parent::save($src, $orderingFilter, $ignore)) {
         if ($this->option_id) {
             if (isset($src['option_value']) && count($src['option_value'])) {
                 $ovTable = JTable::getInstance('optionvalues', 'Table');
                 $status = true;
                 foreach ($src['option_value'] as $optionvalue) {
                     $optionvalue['option_id'] = $this->option_id;
                     if (!$ovTable->save($optionvalue)) {
                         $status = false;
                     }
                 }
             }
         }
     }
     return $status;
 }
开发者ID:ForAEdesWeb,项目名称:AEW4,代码行数:20,代码来源:option.php

示例7: save

 /**
  * Method to provide a shortcut to binding, checking and storing a JTable
  * instance to the database table.  The method will check a row in once the
  * data has been stored and if an ordering filter is present will attempt to
  * reorder the table rows based on the filter.  The ordering filter is an instance
  * property name.  The rows that will be reordered are those whose value matches
  * the JTable instance for the property specified.
  *
  * @param   mixed   $src             An associative array or object to bind to the JTable instance.
  * @param   string  $orderingFilter  Filter for the order updating
  * @param   mixed   $ignore          An optional array or space separated list of properties
  *                                    to ignore while binding.
  *
  * @return  boolean  True on success.
  *
  * @link    http://docs.joomla.org/JTable/save
  * @since   11.1
  */
 public function save($src, $orderingFilter = '', $ignore = '')
 {
     return parent::save($src, $orderingFilter, $ignore);
 }
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:22,代码来源:queue.php

示例8: save

 function save($data)
 {
     unset($this->displayField);
     parent::save($data);
 }
开发者ID:reeleis,项目名称:ohiocitycycles,代码行数:5,代码来源:dttable.php

示例9: save

 /**
  *	check for cache remove.
  **/
 function save($source, $order_filter = '', $ignore = '')
 {
     $this->deleteCache(CCache::METHOD_SAVE);
     return parent::save($source, $order_filter, $ignore);
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:8,代码来源:cache.php


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