Exemplo n.º 1
0
 public function save()
 {
     if (!$this->getId()) {
         $this->setLayoutId(1)->setTmpKey(uniqid())->setSubdomainIsValidated(1)->setIsActive(1)->setIsLocked(0);
     }
     return parent::save();
 }
Exemplo n.º 2
0
 public function save()
 {
     if ($this->getIsIllimited()) {
         $this->setEndDate(null);
     }
     parent::save();
 }
Exemplo n.º 3
0
 public function save()
 {
     if (!$this->getId()) {
         $this->setIsRead(0);
     }
     return parent::save();
 }
Exemplo n.º 4
0
 public function save()
 {
     parent::save();
     if ($this->getAppId() and is_array($this->_value_ids)) {
         $this->saveValueIds($this->getAppId());
     }
 }
Exemplo n.º 5
0
 public function save()
 {
     if (!$this->getPeriodId()) {
         $this->setPeriodId(self::PERIOD_WEEKLY);
     }
     return parent::save();
 }
Exemplo n.º 6
0
 public function save()
 {
     if (!$this->getId()) {
         $this->setTypeId($this->_type_id);
     }
     parent::save();
     return $this;
 }
Exemplo n.º 7
0
 public function save()
 {
     parent::save();
     if ($this->_language_data) {
         $this->getTable()->saveLanguageData($this->getId(), $this->_language_data);
     }
     return $this;
 }
Exemplo n.º 8
0
 public function save()
 {
     parent::save();
     if ($resources = $this->getResources()) {
         $this->getTable()->saveResources($this->getId(), $resources);
     }
     return $this;
 }
Exemplo n.º 9
0
 public function save()
 {
     parent::save();
     $blocks = $this->getData('block') ? $this->getData('block') : array();
     //        if($this->getData('block')) {
     $this->getTable()->saveBlock($this->getId(), $blocks);
     //        }
 }
Exemplo n.º 10
0
 public function save()
 {
     // S'il n'y a pas de période défini pour le jeu, affecte la période par défaut (1 semaine)
     if (!$this->getPeriodId()) {
         $this->setPeriodId(self::PERIOD_WEEKLY);
     }
     return parent::save();
 }
Exemplo n.º 11
0
 public function save()
 {
     $price = trim(str_replace(array(Core_Model_Language::getCurrencySymbol(), ' '), '', $this->getData('price')));
     $filter = new Zend_Filter_LocalizedToNormalized();
     $filter->setOptions(array('locale' => Zend_Registry::get('Zend_Locale')));
     $this->setData('price', $filter->filter($price));
     parent::save();
     return $this;
 }
Exemplo n.º 12
0
 public function save()
 {
     if ($this->getAppId()) {
         $this->getTable()->saveAppBlock($this);
     } else {
         parent::save();
     }
     return $this;
 }
Exemplo n.º 13
0
 public function save($comment_id, $customer_id, $ip, $ua)
 {
     $duplicate_like = $this->getTable()->findByIp($comment_id, $customer_id, $ip, $ua);
     if (count($duplicate_like) == 0) {
         parent::save();
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 14
0
 public function save()
 {
     parent::save();
     if (!$this->getIsDeleted() and $this->getTypeId() == 'picasa' || $this->getTypeId() == 'instagram') {
         if ($this->getTypeInstance()->getId()) {
             $this->getTypeInstance()->delete();
         }
         $this->getTypeInstance()->setData($this->_getTypeInstanceData())->setGalleryId($this->getId())->save();
     }
     return $this;
 }
Exemplo n.º 15
0
 public function save()
 {
     $isDeleted = $this->getIsDeleted();
     parent::save();
     if (!$isDeleted) {
         if ($this->getTypeInstance()->getId()) {
             $this->getTypeInstance()->delete();
         }
         $this->getTypeInstance()->setData($this->_getTypeInstanceData())->setGalleryId($this->getId())->save();
     }
     return $this;
 }
Exemplo n.º 16
0
 public function save()
 {
     if (!$this->getSkipIsVisibleState()) {
         //            $config = new Comment_Model_Pos_Config();
         //            $config->findByPosId($this->getPosId());
         //            $this->setIsVisible((int) $config->isAutocommit());
         //            Zend_Debug::dump($config->getData());
         //            Zend_Debug::dump($this->getData());
         //            die;
     }
     $this->setIsVisible(1);
     return parent::save();
 }
Exemplo n.º 17
0
 public function save()
 {
     parent::save();
     if ($this->getData("message_files")) {
         $new_files = array();
         foreach ($this->getData("message_files") as $key => $file) {
             if ($file and $file != "") {
                 $new_files[] = $this->saveFile($file);
             }
         }
         $this->setMessageFiles($new_files);
     }
 }
Exemplo n.º 18
0
 public function save()
 {
     $countries = Zend_Registry::get('Zend_Locale')->getTranslationList('Territory', null, 2);
     if ($this->getCountryCode()) {
         if (empty($countries[$this->getCountryCode()])) {
             throw new Exception($this->_("An error occurred while saving. The country is not valid."));
         } else {
             if ($this->getCountry() != $countries[$this->getCountryCode()]) {
                 $this->setCountry($countries[$this->getCountryCode()]);
             }
         }
     }
     return parent::save();
 }
Exemplo n.º 19
0
 public function save()
 {
     if (!$this->getId()) {
         $this->setKey(uniqid());
         if (!$this->getLayoutId()) {
             $this->setLayoutId(1);
         }
     }
     parent::save();
     if (!empty($this->_admin_ids)) {
         foreach ($this->_admin_ids as $admin_id) {
             $this->getTable()->addAdmin($this->getId(), $admin_id);
         }
     }
     return $this;
 }
Exemplo n.º 20
0
 public function save()
 {
     parent::save();
     if ($this->getNewOption() and !$this->getIsDeleted()) {
         $new_option_ids = array();
         foreach ($this->getNewOption() as $option_id => $new_option) {
             $is_new = false;
             $option = new Catalog_Model_Product_Group_Option();
             if (stripos($option_id, 'new') === false) {
                 $new_option['option_id'] = $option_id;
             } else {
                 $is_new = true;
             }
             $new_option['group_id'] = $this->getId();
             $option->addData($new_option)->save();
             if ($is_new) {
                 $new_option_ids[] = $option->getId();
             }
         }
         $this->setNewOptionIds($new_option_ids);
     }
 }
Exemplo n.º 21
0
 public function save()
 {
     if (!$this->getIsDeleted()) {
         if (!$this->getPosition()) {
             $this->setPosition($this->findLastPosition($this->getValueId(), $this->getParentId()));
         }
     } else {
         foreach ($this->getChildren() as $child) {
             $child->setIsDeleted(1)->save();
         }
     }
     parent::save();
     if (!$this->getData('is_deleted')) {
         if (!empty($this->_products)) {
             foreach ($this->_products as $product) {
                 $product->setCategoryId($this->getId())->setValueId($this->getValueId())->save();
             }
         }
     } else {
         if (!$this->getParentId()) {
             foreach ($this->getChildren() as $child) {
                 foreach ($child->getProducts() as $product) {
                     $product->delete();
                 }
             }
             foreach ($this->getProducts() as $product) {
                 $product->delete();
             }
         }
     }
 }
Exemplo n.º 22
0
 public function save()
 {
     if ($this->getCustomerCardId() == 0) {
         $this->setCustomerCardId(null)->setId(null);
     }
     parent::save();
 }
Exemplo n.º 23
0
 public function save()
 {
     parent::save();
     if (!is_null($this->_social_datas)) {
         $datas = array();
         foreach ($this->_social_datas as $type => $data) {
             $datas[] = array('type' => $type, 'social_id' => $data['id'], 'datas' => serialize(!empty($data['datas']) ? $data['datas'] : array()));
         }
         $this->getTable()->insertSocialDatas($this->getId(), $datas);
     }
 }
Exemplo n.º 24
0
 public function save()
 {
     $this->setRemoteAddr($this->getRemoteAddr())->setVisitedAt($this->formatDate(null, 'y-MM-dd HH:mm:ss'));
     return parent::save();
 }
Exemplo n.º 25
0
 public function save()
 {
     $this->checkType();
     if (!$this->getIsDeleted()) {
         if (!$this->getPosition()) {
             $this->setPosition($this->findLastPosition($this->getValueId()));
         }
         if (!$this->getData('type')) {
             $this->setData('type', 'simple');
         }
         if ($this->getData('type') == 'simple') {
             $price = Core_Model_Language::normalizePrice($this->getData('price'));
             $this->setData('price', $price);
         }
         //MCommerce multi pictures
         $this->addPictures();
         $this->deletePictures();
         parent::save();
         if ($this->getNewCategoryIds()) {
             $this->getTable()->saveCategoryIds($this->getId(), $this->getNewCategoryIds());
         }
         $this->getType()->setProduct($this)->save();
     } else {
         parent::save();
     }
     return $this;
 }
Exemplo n.º 26
0
 public function save()
 {
     $this->checkType();
     if (!$this->getPosition()) {
         $this->setPosition($this->findLastPosition($this->getValueId()));
     }
     if (!$this->getData('type')) {
         $this->setData('type', 'simple');
     }
     if ($this->getData('type') == 'simple') {
         $price = Core_Model_Language::normalizePrice($this->getData('price'));
         $this->setData('price', $price);
     }
     parent::save();
     if ($this->getNewCategoryIds()) {
         $this->getTable()->saveCategoryIds($this->getId(), $this->getNewCategoryIds());
     }
     $this->getType()->setProduct($this)->save();
     return $this;
 }