示例#1
0
 public function add($autodate = true, $nullValues = false)
 {
     if (parent::add($autodate, $nullValues)) {
         Hook::exec('actionPaymentCCAdd', array('paymentCC' => $this));
         return true;
     }
     return false;
 }
示例#2
0
 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
0
 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
0
 public function add($autodate = true, $null_values = false)
 {
     $this->file_size = filesize(_PS_DOWNLOAD_DIR_ . $this->file);
     return parent::add($autodate, $null_values);
 }
示例#5
0
 /**
  * @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
0
 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
0
 /**
  * @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
0
 public function add($autodate = true, $null_values = false)
 {
     return parent::add($autodate, $null_values) && $this->_setCache();
 }
示例#9
0
 /**
  * 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
0
 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
0
 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
0
 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);
 }