本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}