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


PHP Mage_Core_Model_Abstract::setFromDate方法代码示例

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


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

示例1: _beforeSave

 /**
  * Prepare target rule before save
  *
  * @param Mage_Core_Model_Abstract $object
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->getFromDate() instanceof Zend_Date) {
         $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     } else {
         $object->setFromDate(null);
     }
     if ($object->getToDate() instanceof Zend_Date) {
         $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     } else {
         $object->setToDate(null);
     }
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:18,代码来源:Rule.php

示例2: _beforeSave

 /**
  * Prepare object data for saving
  *
  * @param Mage_Core_Model_Abstract $object
  */
 public function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getFromDate()) {
         $date = new Zend_Date(Mage::getModel('core/date')->gmtTimestamp());
         $date->setHour(0)->setMinute(0)->setSecond(0);
         $object->setFromDate($date);
     }
     $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     if (!$object->getToDate()) {
         $object->setToDate(new Zend_Db_Expr('NULL'));
     } else {
         $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     }
     parent::_beforeSave($object);
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:20,代码来源:Rule.php

示例3: _beforeSave

 public function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getFromDate()) {
         $object->setFromDate(new Zend_Date(Mage::getModel('core/date')->gmtTimestamp()));
     }
     if ($object->getFromDate() instanceof Zend_Date) {
         $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     }
     if (!$object->getToDate()) {
         $object->setToDate(new Zend_Db_Expr('NULL'));
     } else {
         if ($object->getToDate() instanceof Zend_Date) {
             $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
         }
     }
     parent::_beforeSave($object);
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:17,代码来源:Special.php

示例4: _beforeSave

 public function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $object->setFromDate($this->formatDate($object->getFromDate()));
     $object->setToDate($this->formatDate($object->getToDate()));
     if (!$object->getDiscountQty()) {
         $object->setDiscountQty(new Zend_Db_Expr('NULL'));
     }
     parent::_beforeSave($object);
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:9,代码来源:Rule.php

示例5: _beforeSave

 /**
  * Prepare object data for saving
  *
  * @param Mage_Core_Model_Abstract $object
  */
 public function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getFromDate()) {
         $date = Mage::app()->getLocale()->date();
         $date->setHour(0)->setMinute(0)->setSecond(0);
         $object->setFromDate($date);
     }
     if ($object->getFromDate() instanceof Zend_Date) {
         $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     }
     if (!$object->getToDate()) {
         $object->setToDate(new Zend_Db_Expr('NULL'));
     } else {
         if ($object->getToDate() instanceof Zend_Date) {
             $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
         }
     }
     parent::_beforeSave($object);
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:24,代码来源:Pointrules.php

示例6: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $dateFormatIso = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
     if (!$object->getFromDate()) {
         $object->setFromDate(date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())));
     } else {
         $object->setFromDate(Mage::app()->getLocale()->date($object->getFromDate(), $dateFormatIso));
         $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
         $object->setFromDate(Mage::getSingleton('core/date')->gmtDate(null, $object->getFromDate()));
     }
     if (!$object->getToDate()) {
         $object->setToDate();
     } else {
         $object->setToDate(Mage::app()->getLocale()->date($object->getToDate(), $dateFormatIso));
         $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
         $object->setToDate(Mage::getSingleton('core/date')->gmtDate(null, $object->getToDate()));
     }
     return $this;
 }
开发者ID:ramantalkin,项目名称:tmp01skin,代码行数:19,代码来源:Megamenu.php

示例7: _beforeSave

 /**
  * On beforeSave
  *
  * @param Mage_Core_Model_Abstract $object
  */
 public function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getFromDate()) {
         $object->setFromDate(Mage::app()->getLocale()->date());
     }
     if ($object->getFromDate() instanceof Zend_Date) {
         $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     }
     if (!$object->getToDate()) {
         $object->setToDate(new Zend_Db_Expr('NULL'));
     } else {
         if ($object->getToDate() instanceof Zend_Date) {
             $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
         }
     }
     if (!$object->getDiscountQty()) {
         $object->setDiscountQty(new Zend_Db_Expr('NULL'));
     }
     parent::_beforeSave($object);
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:25,代码来源:Rule.php

示例8: _beforeSave

 public function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $startDate = $object->getFromDate();
     if ($startDate == '') {
         //$startDate = Mage::app()->getLocale()->date();
         $startDate = Mage::getModel('core/date')->gmtDate();
     }
     $object->setFromDate($this->formatDate($startDate));
     $object->setToDate($this->formatDate($object->getToDate()));
     parent::_beforeSave($object);
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:11,代码来源:Rule.php

示例9: _beforeSave

 public function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (is_array($object->getData('customer_group_ids'))) {
         $object->setData('customer_group_ids', implode(',', $object->getData('customer_group_ids')));
     }
     if (is_array($object->getData('website_ids'))) {
         $object->setData('website_ids', implode(',', $object->getData('website_ids')));
     }
     if (!$object->getFromDate()) {
         $object->setFromDate(Mage::app()->getLocale()->date());
     }
     if ($object->getFromDate() instanceof Zend_Date) {
         $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     }
     if (!$object->getToDate()) {
         $object->setToDate(new Zend_Db_Expr('NULL'));
     } else {
         if ($object->getToDate() instanceof Zend_Date) {
             $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
         }
     }
 }
开发者ID:HPTTeam,项目名称:hackathon,代码行数:22,代码来源:Rule.php


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