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


PHP Mage_Core_Model_Abstract::save方法代码示例

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


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

示例1: _testUpdate

 protected function _testUpdate()
 {
     foreach ($this->_updateData as $key => $value) {
         $this->_model->setDataUsingMethod($key, $value);
     }
     $this->_model->save();
     $model = $this->_getEmptyModel();
     $model->load($this->_model->getId());
     foreach ($this->_updateData as $key => $value) {
         PHPUnit_Framework_Assert::assertEquals($value, $model->getDataUsingMethod($key), 'CRUD Update "' . $key . '" error');
     }
 }
开发者ID:nemphys,项目名称:magento2,代码行数:12,代码来源:Entity.php

示例2: save

 /**
  * @param \Mage_Core_Model_Abstract $product
  * @param array $gallery
  * @param bool $save
  * @throws ProductMediaGalleryImageNotFound
  * @throws \Exception
  */
 public static function save(\Mage_Core_Model_Abstract $product, array $gallery, $save = true)
 {
     if (!@file_exists($gallery['image'])) {
         throw new ProductMediaGalleryImageNotFound('Specified product fixture gallery image does not exists -> ' . $gallery['image']);
     }
     $product->addImageToMediaGallery($gallery['image'], ['image', 'thumbnail', 'small_image'], false, false);
     if ($save) {
         $product->save();
     }
 }
开发者ID:ctasca,项目名称:magefix,代码行数:17,代码来源:MediaGalleryImage.php

示例3: save

 public function save()
 {
     if (!$this->getStoreId()) {
         return parent::save();
     }
     $cate_store = Mage::getModel('faq/faqstore')->loadByFaqIdStore($this->getFaqId(), $this->getStoreId());
     $id = $cate_store->getId();
     $cate_store->setData($this->getData())->setId($id)->save();
     return $this;
 }
开发者ID:Thinlt,项目名称:simicart,代码行数:10,代码来源:Faq.php

示例4: save

 /**
  * Ovewrite default save method
  */
 public function save()
 {
     //Se a flag de gravação de log está ativada
     if ($this->grava_log) {
         try {
             parent::save();
         } catch (Exception $e) {
             $mensagem = '(' . Mage::getModel('core/date')->date("Y-m-d H:i:s") . ') ' . PHP_EOL . serialize($this->getData()) . PHP_EOL . PHP_EOL;
             Mage::log($mensagem, Zend_Log::DEBUG);
         }
     }
 }
开发者ID:adrianomelo5,项目名称:magento,代码行数:15,代码来源:Log.php

示例5: save

 public function save()
 {
     $speed = $this->getConfSpeed();
     $title = $this->getTitle();
     // Validate speed
     if (!is_numeric($speed)) {
         Mage::getSingleton('core/session')->addError("Speed must be set using numerical value only.");
         return false;
     }
     // Validate title
     if (preg_match('/[^-_. 0-9A-Za-z]/', $title)) {
         Mage::getSingleton('core/session')->addError("Title must be alphanumeric and contain only spaces, dashes, or underscores.");
         return false;
     }
     return parent::save();
 }
开发者ID:vivekkamble,项目名称:magento_basic,代码行数:16,代码来源:Slider.php

示例6: save

 public function save()
 {
     if (!$this->getStoreLatitude() || !$this->getStoreLongitude()) {
         $address['street'] = $this->getAddress();
         $address['city'] = $this->getCity();
         $address['region'] = $this->getRegion();
         $address['zipcode'] = $this->getZipcode();
         $address['country'] = $this->getCountryName();
         $coordinates = Mage::getModel('storepickup/gmap')->getCoordinates($address);
         if ($coordinates) {
             $this->setStoreLatitude($coordinates['lat']);
             $this->setStoreLongitude($coordinates['lng']);
         } else {
             $this->setStoreLatitude('0.000');
             $this->setStoreLongitude('0.000');
         }
     }
     return parent::save();
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:19,代码来源:Store.php

示例7: save

 /**
  * Save object data
  *
  * @see Mage_Core_Model_Abstract::save()
  * @return Mage_Reports_Model_Product_Index_Abstract
  */
 public function save()
 {
     if (!$this->hasVisitorId()) {
         $this->setVisitorId($this->getVisitorId());
     }
     if (!$this->hasCustomerId()) {
         $this->setCustomerId($this->getCustomerId());
     }
     if (!$this->hasStoreId()) {
         $this->setStoreId($this->getStoreId());
     }
     if (!$this->hasAddedAt()) {
         $this->setAddedAt(now());
     }
     // Thanks to new performance tweaks it is possible to switch off visitor logging
     // This check is needed to make sure report record has either visitor id or customer id
     if ($this->hasVisitorId() || $this->hasCustomerId()) {
         parent::save();
     }
     return $this;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:27,代码来源:Abstract.php

示例8: save

 public function save()
 {
     $is_canceled = false;
     if ($this->getId()) {
         $data = $this->getData();
         $this->load($this->getId());
         if ($this->getStatus() != 2 && isset($data['status']) && $data['status'] == 2) {
             $is_canceled = true;
             $this->noticeCanceled();
         }
         $this->setData($data);
     }
     parent::save();
     if ($is_canceled) {
         $auction = Mage::getModel('auction/productauction')->load($this->getProductauctionId());
         $lastBid = $auction->getLastBid();
         if ($lastBid->getId() < $this->getId()) {
             $lastBid->noticeHighest();
         }
     }
 }
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:21,代码来源:Auction.php

示例9: save

 /**
  * Save model plus its options
  * Ensures saving options in case when resource model was not changed
  */
 public function save()
 {
     $hasDataChanges = $this->hasDataChanges();
     $this->_flagOptionsSaved = false;
     parent::save();
     if ($hasDataChanges && !$this->_flagOptionsSaved) {
         $this->_saveItemOptions();
     }
 }
开发者ID:natxetee,项目名称:magento2,代码行数:13,代码来源:Item.php

示例10: saveCMSData

 private function saveCMSData(Mage_Core_Model_Abstract $CMSModel, array $CMSData)
 {
     $CMSModel->setData($CMSData);
     $CMSModel->setStores(array(0));
     $CMSModel->save();
 }
开发者ID:occitech,项目名称:magento-setup-utility,代码行数:6,代码来源:Setup.php

示例11: save

 public function save()
 {
     //var_dump($this->getData());
     return parent::save();
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:5,代码来源:Set.php

示例12: save

 /**
  * Save object data
  *
  * @return Mage_Catalog_Model_Product_Compare_Item
  */
 public function save()
 {
     if ($this->hasCustomerId() || $this->hasVisitorId()) {
         parent::save();
     }
     return $this;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:12,代码来源:Item.php

示例13: _saveFixtureWithModelAndData

 /**
  * @param MagentoModel $mageModel
  * @param $data
  * @return mixed
  * @throws \Exception
  */
 protected function _saveFixtureWithModelAndData(MagentoModel $mageModel, $data)
 {
     MagentoStoreScope::setAdminStoreScope();
     $mageModel->setData($data);
     $mageModel->save();
     MagentoStoreScope::setCurrentStoreScope();
     return $mageModel->getId();
 }
开发者ID:ctasca,项目名称:magefix,代码行数:14,代码来源:AbstractBuilder.php

示例14: save

 public function save()
 {
     parent::save();
     $subscriptionHistory = Mage::getModel('adyen_subscription/subscription_history');
     $subscriptionHistory->saveFromSubscription($this);
     return $this;
 }
开发者ID:Adyen,项目名称:adyen-magento-subscription,代码行数:7,代码来源:Subscription.php

示例15: save

 public function save()
 {
     $this->setData('updated_at', gmdate('Y-m-d H:i:s'));
     parent::save();
 }
开发者ID:RxOuchy,项目名称:LDS_Client_Solutions,代码行数:5,代码来源:Map.php


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