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


PHP F0FTable::onBeforeStore方法代码示例

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


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

示例1: 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

示例2: onBeforeStore

 protected function onBeforeStore($updateNulls = false)
 {
     if (!isset($this->sku) || empty($this->sku)) {
         //sku is empty. Auto generate it based on product name
         $product_helper = J2Store::product();
         $this->sku = $product_helper->generateSKU($this);
     }
     return parent::onBeforeStore($updateNulls);
 }
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:9,代码来源:variant.php

示例3: 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)
 {
     $result = parent::onBeforeStore($updateNulls);
     if ($result) {
         $params = json_decode($this->params);
         $this->evergreentype_id = $params->evergreen;
     }
     return $result;
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:16,代码来源:advancedattr.php

示例4: onBeforeStore

 /**
  * Run the onAKUserSaveData event on the plugins before saving a row
  *
  * @param boolean $updateNulls
  * @return bool
  */
 function onBeforeStore($updateNulls)
 {
     if ($result = parent::onBeforeStore($updateNulls)) {
         JLoader::import('joomla.plugin.helper');
         JPluginHelper::importPlugin('akeebasubs');
         $dispatcher = JDispatcher::getInstance();
         $jResponse = $dispatcher->trigger('onAKUserSaveData', array($this));
         if (in_array(false, $jResponse)) {
             $this->setError($dispatcher->getError());
             return false;
         }
     }
     return $result;
 }
开发者ID:jonatasmm,项目名称:akeebasubs,代码行数:20,代码来源:user.php

示例5: onBeforeStore

 protected function onBeforeStore($updateNulls)
 {
     if (parent::onBeforeStore($updateNulls)) {
         $tz = JFactory::getConfig()->get('offset');
         $date = F0FPlatform::getInstance()->getDate('now', $tz, false);
         if (!$this->j2store_cart_id) {
             //get the IP of the customer
             $this->customer_ip = $_SERVER['REMOTE_ADDR'];
             $browser = JBrowser::getInstance();
             $this->cart_browser = $browser->getBrowser();
             $analytics = array();
             $analytics['is_mobile'] = $browser->isMobile();
             $this->cart_analytics = json_encode($analytics);
             $this->created_on = $date->toSql(true);
         } else {
             $this->modified_on = $date->toSql(true);
         }
         return true;
     }
     return false;
 }
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:21,代码来源:cart.php

示例6: onBeforeStore

 protected function onBeforeStore($updateNulls)
 {
     $result = parent::onBeforeStore($updateNulls);
     if ($result) {
         $slug = $this->getColumnAlias('slug');
         if (property_exists($this, $slug)) {
             $this->{$slug} = str_replace('-', '_', $this->{$slug});
         }
     }
     // Make sure assigned subscription levels really do exist and normalize the list
     if (!empty($this->akeebasubs_level_id)) {
         if (is_array($this->akeebasubs_level_id)) {
             $subs = $this->akeebasubs_level_id;
         } else {
             $subs = explode(',', $this->akeebasubs_level_id);
         }
         if (empty($subs)) {
             $this->akeebasubs_level_id = '';
         } else {
             $subscriptions = array();
             foreach ($subs as $id) {
                 $subObject = F0FModel::getTmpInstance('Levels', 'AkeebasubsModel')->setId($id)->getItem();
                 $id = null;
                 if (is_object($subObject)) {
                     if ($subObject->akeebasubs_level_id > 0) {
                         $id = $subObject->akeebasubs_level_id;
                     }
                 }
                 if (!is_null($id)) {
                     $subscriptions[] = $id;
                 }
             }
             $this->akeebasubs_level_id = implode(',', $subscriptions);
         }
     }
     return $result;
 }
开发者ID:jonatasmm,项目名称:akeebasubs,代码行数:37,代码来源:customfield.php

示例7: 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)
 {
     $result = parent::onBeforeStore($updateNulls);
     $this->modified = '0000-00-00 00:00:00';
     return $result;
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:13,代码来源:feedcontent.php


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