本文整理汇总了PHP中JModelLegacy::add方法的典型用法代码示例。如果您正苦于以下问题:PHP JModelLegacy::add方法的具体用法?PHP JModelLegacy::add怎么用?PHP JModelLegacy::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JModelLegacy
的用法示例。
在下文中一共展示了JModelLegacy::add方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($autodate = true, $nullValues = false)
{
if (parent::add($autodate, $nullValues)) {
Hook::exec('actionPaymentCCAdd', array('paymentCC' => $this));
return true;
}
return false;
}
示例2: add
public function add($autodate = true, $nullValues = false)
{
if ($this->group_type == 'color') {
$this->is_color_group = 1;
} else {
$this->is_color_group = 0;
}
if ($this->position <= 0) {
$this->position = AttributeGroup::getHigherPosition() + 1;
}
$return = parent::add($autodate, true);
Hook::exec('actionAttributeGroupSave', array('id_attribute_group' => $this->id));
return $return;
}
示例3: add
public function add($autodate = true, $null_values = false)
{
if (!parent::add($autodate, $null_values)) {
return false;
}
$product = new Product((int) $this->id_product);
if ($product->getType() == Product::PTYPE_VIRTUAL) {
StockAvailable::setProductOutOfStock((int) $this->id_product, 1, null, (int) $this->id);
} else {
StockAvailable::setProductOutOfStock((int) $this->id_product, StockAvailable::outOfStock((int) $this->id_product), null, $this->id);
}
SpecificPriceRule::applyAllRules(array((int) $this->id_product));
Product::updateDefaultAttribute($this->id_product);
return true;
}
示例4: add
public function add($autodate = true, $null_values = false)
{
$this->file_size = filesize(_PS_DOWNLOAD_DIR_ . $this->file);
return parent::add($autodate, $null_values);
}
示例5: add
/**
* @see ObjectModel::add()
*/
public function add()
{
$db = JFactory::getDBO();
$this->date_add = date('Y-m-d H:i:s');
$this->date_upd = date('Y-m-d H:i:s');
if (JeproshopShopModelShop::isTableAssociated('address')) {
$shopListIds = JeproshopShopModelShop::getContextListShopIds();
if (count($this->shop_list_id) > 0) {
$shopListIds = $this->shop_list_id;
}
}
if (JeproshopShopModelShop::checkDefaultShopId('address')) {
$this->default_shop_id = min($shopListIds);
}
$query = "INSERT INTO " . $db->quoteName('#__jeproshop_address');
if (!parent::add($autodate, $null_values)) {
return false;
}
if (JeproshopTools::isUnsignedInt($this->customer_id)) {
JeproshopCustomerModelCustomer::resetAddressCache($this->customer_id);
}
return true;
}
示例6: add
public function add($autodate = true, $null_values = false)
{
if ($this->position <= 0) {
$this->position = Carrier::getHigherPosition() + 1;
}
if (!parent::add($autodate, $null_values) || !Validate::isLoadedObject($this)) {
return false;
}
if (!($count = Db::getInstance()->getValue('SELECT count(`id_carrier`) FROM `' . _DB_PREFIX_ . $this->def['table'] . '` WHERE `deleted` = 0'))) {
return false;
}
if ($count == 1) {
Configuration::updateValue('PS_CARRIER_DEFAULT', (int) $this->id);
}
// Register reference
Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . $this->def['table'] . '` SET `id_reference` = ' . $this->id . ' WHERE `id_carrier` = ' . $this->id);
return true;
}
示例7: add
/**
* @see ObjectModel::add()
*/
public function add($autodate = true, $null_values = false)
{
if (!parent::add($autodate, $null_values)) {
return false;
}
Configuration::updateGlobalValue('PS_CART_RULE_FEATURE_ACTIVE', '1');
return true;
}
示例8: add
public function add($autodate = true, $null_values = false)
{
return parent::add($autodate, $null_values) && $this->_setCache();
}
示例9: add
/**
* Overriding check if currency rate is not empty and if currency with the same iso code already exists.
* If it's true, currency is not added.
*
* @see ObjectModelCore::add()
*/
public function add()
{
if ((double) $this->conversion_rate <= 0) {
return false;
}
if (JeproshopCurrencyModelCurrency::exists($this->iso_code, $this->iso_code_num)) {
return false;
} else {
return parent::add($autodate, $nullValues);
}
}
示例10: add
public function add($autodate = true, $null_values = false)
{
$return = parent::add($autodate, $null_values) && self::addModuleRestrictions(array(), array(array('id_country' => $this->id)), array());
return $return;
}
示例11: add
public function add($autodate = true, $null_values = true)
{
$this->last_passwd_gen = date('Y-m-d H:i:s', strtotime('-' . Configuration::get('PS_PASSWD_TIME_BACK') . 'minutes'));
$this->saveOptin();
$this->updateTextDirection();
return parent::add($autodate, $null_values);
}
示例12: add
public function add($autodate = true, $null_values = false)
{
$db = JFactory::getDBO();
$this->date_add = date('Y-m-d H:i:s');
if (isset($this->product_download_id) && !$this->force_id) {
unset($this->product_download_id);
}
return (bool) parent::add($autodate, $null_values);
}