• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP F0FTable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createCoupon

 public function createCoupon($key, $pwd)
 {
     // Do I have a key/pwd pair?
     if (!$key || !$pwd) {
         return array('error' => JText::_('COM_AKEEBASUBS_APICOUPONS_INVALID_CREDENTIALS'));
     }
     $table = $this->getTable();
     $table->load(array('key' => $key, 'password' => $pwd));
     // Are they valid?
     if (!$table->akeebasubs_apicoupon_id || !$table->enabled) {
         return array('error' => JText::_('COM_AKEEBASUBS_APICOUPONS_INVALID_CREDENTIALS'));
     }
     // Do I hit a limit?
     if (!$this->performApiChecks($table)) {
         return array('error' => JText::_('COM_AKEEBASUBS_APICOUPONS_LIMIT_EXCEEDED'));
     }
     // If I'm here, I'm clear to go
     JLoader::import('joomla.user.helper');
     $coupon = F0FTable::getAnInstance('Coupon', 'AkeebasubsTable');
     $data['akeebasubs_apicoupon_id'] = $table->akeebasubs_apicoupon_id;
     $data['title'] = 'API coupon for: ' . $table->title;
     $data['coupon'] = strtoupper(JUserHelper::genRandomPassword(10));
     $data['subscriptions'] = $table->subscriptions;
     // By default I want the coupon to be single-use
     $data['hitslimit'] = 1;
     $data['userhits'] = 1;
     $data['type'] = $table->type;
     $data['value'] = $table->value;
     if (!$coupon->save($data)) {
         return array('error' => JText::_('COM_AKEEBASUBS_APICOUPONS_COUPON_ERROR'));
     }
     return array('coupon' => $coupon->coupon);
 }
开发者ID:jonatasmm,项目名称:akeebasubs,代码行数:33,代码来源:apicoupons.php


示例2: deleteChildren

 public function deleteChildren($oid)
 {
     $status = true;
     //should delete geozonerules
     $geozonerules = F0FModel::getTmpInstance('GeozoneRules', 'J2StoreModel')->geozone_id($oid)->getList();
     $geozonerule = F0FTable::getAnInstance('GeozoneRule', 'J2StoreTable');
     if (isset($geozonerules) && count($geozonerules)) {
         foreach ($geozonerules as $grule) {
             if (!$geozonerule->delete($grule->j2store_geozonerule_id)) {
                 $status = false;
             }
         }
     }
     if ($status) {
         // delete taxrate and also related taxprofile rules...
         $taxrates = F0FModel::getTmpInstance('Taxrates', 'J2StoreModel')->geozone_id($oid)->getList();
         $taxrate = F0FTable::getAnInstance('Taxrate', 'J2StoreTable');
         if (isset($taxrates) && count($taxrates)) {
             foreach ($taxrates as $trate) {
                 if (!$taxrate->delete($trate->j2store_taxrate_id)) {
                     $status = false;
                 }
             }
         }
     }
     return $status;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:27,代码来源:geozone.php


示例3: update_inventory

 public function update_inventory()
 {
     $app = JFactory::getApplication();
     $quantity = $app->input->getInt('quantity');
     $availability = $app->input->getInt('availability');
     $manage_stock = $app->input->getInt('manage_stock');
     $variant_id = $app->input->getInt('variant_id');
     $json = array();
     if ($variant_id > 0) {
         F0FTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_j2store/tables');
         $productquantities = F0FTable::getInstance('Productquantity', 'J2StoreTable')->getClone();
         $productquantities->load(array('variant_id' => $variant_id));
         $productquantities->variant_id = $variant_id;
         $productquantities->quantity = $quantity;
         if (!$productquantities->store()) {
             $json['error'] = "Problem in Save";
         }
         $variants_table = F0FTable::getInstance('Variant', 'J2StoreTable')->getClone();
         $variants_table->load($variant_id);
         $variants_table->availability = $availability;
         $variants_table->manage_stock = $manage_stock;
         if (!$variants_table->store()) {
             $json['error'] = "Problem in Save";
         }
     }
     if (!$json) {
         $json['success'] = 'index.php?option=com_j2store&view=inventories';
     }
     echo json_encode($json);
     $app->close();
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:31,代码来源:inventories.php


示例4: save

 public function save($data)
 {
     if (parent::save($data)) {
         if ($this->otable->j2store_geozone_id) {
             if (isset($data['zone_to_geo_zone']) && count($data['zone_to_geo_zone'])) {
                 $grtable = F0FTable::getInstance('geozonerule', 'J2StoreTable');
                 $status = true;
                 foreach ($data['zone_to_geo_zone'] as $georule) {
                     $grtable->load($georule['j2store_geozonerule_id']);
                     $georule['geozone_id'] = $this->otable->j2store_geozone_id;
                     try {
                         $grtable->save($georule);
                     } catch (Exception $e) {
                         $status = false;
                     }
                     if (!$status) {
                         break;
                     }
                 }
             } else {
                 return true;
             }
         }
     } else {
         return false;
     }
     return true;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:28,代码来源:geozones.php


示例5: save

 public function save($data)
 {
     if (parent::save($data)) {
         if ($this->otable->j2store_taxprofile_id) {
             if (isset($data['tax-to-taxrule-row']) && count($data['tax-to-taxrule-row'])) {
                 $trTable = F0FTable::getInstance('taxrules', 'Table');
                 $status = true;
                 foreach ($data['tax-to-taxrule-row'] as $taxrate) {
                     $trTable->load($taxrate['j2store_taxrule_id']);
                     $taxrate['taxprofile_id'] = $this->otable->j2store_taxprofile_id;
                     try {
                         $trTable->save($taxrate);
                     } catch (Exception $e) {
                         $status = false;
                     }
                     if (!$status) {
                         break;
                     }
                 }
             } else {
                 return true;
             }
         }
     } else {
         return false;
     }
     return true;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:28,代码来源:taxprofiles.php


示例6: onAdd

 protected function onAdd($tpl = null)
 {
     $app = JFactory::getApplication();
     JRequest::setVar('hidemainmenu', true);
     $model = $this->getModel();
     $this->item = $model->runMyBehaviorFlag(true)->getItem();
     $this->currency = J2Store::currency();
     $this->form_prefix = $this->input->getString('form_prefix', '');
     $this->product_source_view = $this->input->getString('product_source_view', 'article');
     $this->product_types = JHtml::_('select.genericlist', $model->getProductTypes(), $this->form_prefix . '[product_type]', array(), 'value', 'text', $this->item->product_type);
     if ($this->item->j2store_product_id) {
         //manufacturers
         $this->manufacturers = J2Html::select()->clearState()->type('genericlist')->name($this->form_prefix . '[manufacturer_id]')->value($this->item->manufacturer_id)->setPlaceHolders(array('' => JText::_('J2STORE_SELECT_OPTION')))->hasOne('Manufacturers')->setRelations(array('fields' => array('key' => 'j2store_manufacturer_id', 'name' => array('company'))))->getHtml();
         //vendor
         $this->vendors = J2Html::select()->clearState()->type('genericlist')->name($this->form_prefix . '[vendor_id]')->value($this->item->vendor_id)->setPlaceHolders(array('' => JText::_('J2STORE_SELECT_OPTION')))->hasOne('Vendors')->setRelations(array('fields' => array('key' => 'j2store_vendor_id', 'name' => array('first_name', 'last_name'))))->getHtml();
         //tax profiles
         $this->taxprofiles = J2Html::select()->clearState()->type('genericlist')->name($this->form_prefix . '[taxprofile_id]')->value($this->item->taxprofile_id)->setPlaceHolders(array('' => JText::_('J2STORE_NOT_TAXABLE')))->hasOne('Taxprofiles')->setRelations(array('fields' => array('key' => 'j2store_taxprofile_id', 'name' => 'taxprofile_name')))->getHtml();
     }
     if ($this->item->j2store_product_id > 0) {
         $this->product_filters = F0FTable::getAnInstance('ProductFilter', 'J2StoreTable')->getFiltersByProduct($this->item->j2store_product_id);
     } else {
         $this->product_filters = array();
     }
     return true;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:25,代码来源:view.html.php


示例7: save

 public function save()
 {
     $task = $this->getTask();
     // get the Application Object
     $app = JFactory::getApplication();
     // get the payment id
     $payment_id = $app->input->getInt('extension_id');
     // if payment id exists
     if ($payment_id) {
         $data = $app->input->getArray($_POST);
         $paymentdata = array();
         $paymentdata['extension_id'] = $payment_id;
         $registry = new JRegistry();
         $registry->loadArray($data);
         $paymentdata['params'] = $registry->toString('JSON');
         try {
             F0FTable::getAnInstance('Payment', 'J2StoreTable')->save($paymentdata);
         } catch (Exception $e) {
             $msg = $e->getMessage();
         }
         switch ($task) {
             case 'apply':
                 parent::apply();
                 break;
             case 'save':
                 parent::save();
                 break;
             case 'savenew':
                 parent::savenew();
                 break;
         }
     }
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:33,代码来源:payments.php


示例8: save

 public function save($data)
 {
     $app = JFactory::getApplication();
     $task = $app->input->getString('task');
     if ($task == 'saveorder') {
         return parent::save($data);
     }
     if (parent::save($data)) {
         if (isset($this->otable->j2store_filtergroup_id)) {
             if (isset($data['filter_value']) && count($data['filter_value'])) {
                 $ovTable = F0FTable::getInstance('filter', 'J2StoreTable');
                 $status = true;
                 foreach ($data['filter_value'] as $filtervalue) {
                     $ovTable->load($filtervalue['j2store_filter_id']);
                     $filtervalue['group_id'] = $this->otable->j2store_filtergroup_id;
                     if (!$ovTable->save($filtervalue)) {
                         $status = false;
                     }
                 }
             } else {
                 return true;
             }
         }
     } else {
         return false;
     }
     return true;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:28,代码来源:filtergroups.php


示例9: save

 public function save($data)
 {
     if (parent::save($data)) {
         if ($this->otable->j2store_option_id) {
             if (is_object($data)) {
                 $data = (array) $data;
             }
             if (isset($data['option_value']) && count($data['option_value'])) {
                 $ovTable = F0FTable::getInstance('optionvalue', 'Table');
                 $status = true;
                 foreach ($data['option_value'] as $optionvalue) {
                     $ovTable->load($optionvalue['j2store_optionvalue_id']);
                     $optionvalue['option_id'] = $this->otable->j2store_option_id;
                     if (!$ovTable->save($optionvalue)) {
                         $status = false;
                     }
                 }
             } else {
                 return true;
             }
         }
     } else {
         return false;
     }
     return true;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:26,代码来源:options.php


示例10: callback

 /**
  * callback.
  *
  * @return	void
  */
 public function callback()
 {
     if ($this->csrfProtection) {
         $this->_csrfProtection();
     }
     try {
         // $channelId = $this->input->getUint('channelId');
         $session = JFactory::getSession();
         $channelId = $session->get('channelId');
         // Invalidating
         $session->set('channelId', false);
         $code = $this->input->getString('code');
         $state = $this->input->getString('state');
         if (!empty($code)) {
             $channel = F0FTable::getAnInstance('Channel', 'AutoTweetTable');
             $result = $channel->load($channelId);
             if (!$result) {
                 throw new Exception('LinkedIn Channel failed to load!');
             }
             $lioauth2ChannelHelper = new LiOAuth2ChannelHelper($channel);
             $lioauth2ChannelHelper->authenticate($code, $state);
             // Redirect
             $url = 'index.php?option=com_autotweet&view=channels&task=edit&id=' . $channelId;
             $this->setRedirect($url);
             $this->redirect();
         }
     } catch (Exception $e) {
         $logger = AutotweetLogger::getInstance();
         $logger->log(JLog::ERROR, $e->getMessage());
         throw $e;
     }
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:37,代码来源:lioauth2channels.php


示例11: getTable

 /**
  * Returns the data in $this->_current as a F0FTable instance
  *
  * @return  F0FTable
  *
  * @throws  OutOfBoundsException
  */
 protected function getTable()
 {
     if (!$this->valid()) {
         throw new OutOfBoundsException('Cannot get item past iterator\'s bounds', 500);
     }
     $this->_tableObject->bind($this->_current);
     return $this->_tableObject;
 }
开发者ID:chaudhary4k4,项目名称:modernstore,代码行数:15,代码来源:iterator.php


示例12:

 public function &getItem($id = null)
 {
     $user = JFactory::getUser();
     $this->record = F0FTable::getAnInstance('Vendoruser', 'J2StoreTable');
     $this->record->load($user->id);
     $this->record->products = F0FModel::getTmpInstance('Products', 'J2StoreModel')->vendor_id($this->record->j2store_vendor_id)->enabled(1)->getList();
     return $this->record;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:8,代码来源:vendors.php


示例13: onBeforeSave

 public function onBeforeSave(&$data, &$table)
 {
     $app = JFactory::getApplication();
     $addressTable = F0FTable::getInstance('Address', 'J2storeTable');
     $addressTable->load($data['address_id']);
     $addressTable->save($data);
     $data['address_id'] = $addressTable->j2store_address_id;
     return true;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:9,代码来源:manufacturers.php


示例14: deleteproductfiltervalues

 function deleteproductfiltervalues()
 {
     $o_id = $this->input->getInt('productfiltervalue_id');
     $productfilter = F0FTable::getAnInstance('filter', 'J2StoreTable');
     $json = array();
     $json['success']['msg'] = JText::_('J2STORE_PRODUCT_FILTER_VALUE_DELETE_SUCCESS');
     if (!$productfilter->delete($o_id)) {
         $json['error']['msg'] = JText::_('J2STORE_PRODUCT_FILTER_VALUE_DELETE_ERROR');
     }
     echo json_encode($json);
     JFactory::getApplication()->close();
 }
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:12,代码来源:filtergroups.php


示例15: getRepeatable

 public function getRepeatable()
 {
     $orderinfo = F0FTable::getAnInstance('Orderinfo', 'J2StoreTable');
     $orderinfo->load(array('order_id' => $this->item->order_id));
     $customer_name = $orderinfo->billing_first_name . ' ' . $orderinfo->billing_last_name;
     $html = '';
     $html .= $customer_name;
     $html .= '<br>';
     $html .= '<small>';
     $html .= $this->item->user_email;
     $html .= '</small>';
     return $html;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:13,代码来源:customerdetail.php


示例16: getAddressById

 public function getAddressById($address_id)
 {
     static $sets;
     if (!is_array($sets)) {
         $sets = array();
     }
     if (!isset($sets[$address_id])) {
         $address_table = F0FTable::getInstance('Address', 'J2StoreTable');
         $address_table->load($address_id);
         $sets[$address_id] = $address_table;
     }
     return $sets[$address_id];
 }
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:13,代码来源:addresses.php


示例17: __construct

 /**
  * Instantiate the table object
  *
  * @param   string     $table  Param
  * @param   string     $key    Param
  * @param   JDatabase  &$db    The Joomla! database object
  */
 public function __construct($table, $key, &$db)
 {
     parent::__construct('#__autotweet_automator', 'id', $db);
     $this->xtform = new JRegistry();
     $this->unix_mhdmd = null;
     $this->repeat_until = null;
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:14,代码来源:itemeditor.php


示例18: __construct

 public function __construct($table, $key, &$db, $config = array())
 {
     $table = "#__j2store_productimages";
     //important
     $key = "j2store_productimage_id";
     parent::__construct($table, $key, $db, $config);
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:7,代码来源:productimage.php


示例19: onBeforeStore

 /**
  * The event which runs before storing (saving) data to the database
  *
  * @param   boolean  $updateNulls  Should nulls be saved as nulls (true) or just skipped over (false)?
  *
  * @return  boolean  True to allow saving
  */
 protected function onBeforeStore($updateNulls)
 {
     // BLOB/TEXT default value
     if (!isset($this->params)) {
         $this->params = '';
     }
     return parent::onBeforeStore($updateNulls);
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:15,代码来源:request.php


示例20: check

 public function check()
 {
     $date = new JDate($this->date_from);
     $this->date_from = $date->toSql();
     $date1 = new JDate($this->date_to);
     $this->date_to = $date1->toSql();
     return parent::check();
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:8,代码来源:productprice.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP F3类代码示例发布时间:2022-05-23
下一篇:
PHP F0FPlatform类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap