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


PHP Mage_Core_Model_Mysql4_Abstract类代码示例

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


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

示例1: _afterLoad

 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getIsMassDelete()) {
         $this->_loadStore($object);
     }
     return parent::_afterLoad($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:7,代码来源:Menu.php

示例2: _afterDelete

 /**
  * After delete process
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Bundle_Model_Mysql4_Option
  */
 protected function _afterDelete(Mage_Core_Model_Abstract $object)
 {
     parent::_afterDelete($object);
     $condition = $this->_getWriteAdapter()->quoteInto('option_id = ?', $object->getId());
     $this->_getWriteAdapter()->delete($this->getTable('option_value'), $condition);
     return $this;
 }
开发者ID:jauderho,项目名称:magento-mirror,代码行数:13,代码来源:Option.php

示例3: getTable

 public function getTable($name)
 {
     $ret = parent::getTable($name);
     $tablePrefix = (string) Mage::getConfig()->getTablePrefix();
     $ret = preg_replace('~^' . preg_quote($tablePrefix) . '~', '', $ret);
     return $ret;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:7,代码来源:User.php

示例4: load

 public function load(Mage_Core_Model_Abstract $object, $value, $field = null)
 {
     if (is_numeric($value)) {
         return parent::load($object, $value);
     }
     return parent::load($object, $value, 'query_text');
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:7,代码来源:Query.php

示例5: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $object->validate();
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     if ($object->getAttributes() && is_array($object->getAttributes())) {
         $object->setAttributesSerialized(serialize($object->getAttributes()));
     }
     if ($object->getProperties() && is_array($object->getProperties())) {
         $object->setPropertiesSerialized(serialize($object->getProperties()));
     }
     if ($object->getData('attributes_serialized') != $object->getOrigData('attributes_serialized')) {
         $object->setStatus(2);
     }
     if ($object->getData('properties_serialized') != $object->getOrigData('properties_serialized')) {
         $object->setStatus(2);
     }
     if (!$object->getId() && !$object->getIndexInstance()->isAllowMultiInstance()) {
         //check if this index already exists
         $collection = Mage::getModel('searchindex/index')->getCollection()->addFieldToFilter('index_code', $object->getIndexCode());
         if ($collection->count() > 0) {
             Mage::throwException('The index for current content type already exists');
         }
     }
     return parent::_beforeSave($object);
 }
开发者ID:vishalpatel14,项目名称:indiankalaniketan,代码行数:25,代码来源:Index.php

示例6: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew() && !$object->hasCreatedAt()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     return parent::_beforeSave($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:7,代码来源:Mirasvit_Fpc_Model_Resource_Log.php

示例7: _afterSave

 /**
  * Assign page to store views
  *
  * @param Mage_Core_Model_Abstract $object
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     /*
     $condition = $this->_getWriteAdapter()->quoteInto('group_id = ?', $object->getId());
     // process faq item to store relation
     $this->_getWriteAdapter()->delete($this->getTable('ves_brand/group_store'), $condition);
     $stores = (array) $object->getData('stores');
     
     if($stores){
         foreach ((array) $object->getData('stores') as $store) {
             $storeArray = array ();
             $storeArray['group_id'] = $object->getId();
             $storeArray['store_id'] = $store;
             $this->_getWriteAdapter()->insert(
                 $this->getTable('ves_brand/group_store'), $storeArray);
         }   
     }else{
         $storeArray = array ();
         $storeArray['group_id'] = $object->getId();
         $storeArray['store_id'] = $object->getStoreId();
         $this->_getWriteAdapter()->insert(
                 $this->getTable('ves_brand/group_store'), $storeArray);
         
     }
     */
     return parent::_afterSave($object);
 }
开发者ID:adrienManikon,项目名称:iPong,代码行数:32,代码来源:Group.php

示例8: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getIsMassStatus()) {
         $this->saveStore($object);
     }
     return parent::_afterSave($object);
 }
开发者ID:technomagegithub,项目名称:olgo.nl,代码行数:7,代码来源:Link.php

示例9: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     parent::_afterSave($object);
     // process object to store relation
     $stores = $object->getData('store_id');
     if (is_array($stores)) {
         if (empty($stores) || in_array('0', $stores, true)) {
             $stores = array('0');
         }
     } else {
         $stores = array_map('intval', explode(',', strval($stores)));
     }
     $mode = $object->getData('mode');
     $exclCh = $object->getData('exclude_children');
     $priority = $object->getData(self::FIELD_PRIORITY);
     $groups = $object->getData(self::FIELD_GROUPS);
     if (is_array($groups)) {
         $groups = implode(',', $groups);
     } else {
         $groups = (string) $groups;
     }
     foreach ($stores as $store) {
         $this->_getWriteAdapter()->delete($this->_storeTable, $this->_getWriteAdapter()->quoteInto('hp_id = ?', $object->getId()) . ' AND ' . $this->_getWriteAdapter()->quoteInto('store_id = ?', $store));
         if (!$object->getData('delete')) {
             $this->_getWriteAdapter()->insert($this->_storeTable, array(self::FIELD_HP_ID => $object->getId(), self::FIELD_STORE_ID => $store, self::FIELD_HIDEPRICE_MODE => $mode, self::FIELD_IS_EXCL_CHILDREN => (int) (bool) $exclCh, self::FIELD_GROUPS => $groups, self::FIELD_PRIORITY => (int) $priority));
         }
     }
     return $this;
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:29,代码来源:Hideprice.php

示例10: _beforeSave

 public function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
     if ($date = $object->getDateFrom()) {
         $date = Mage::app()->getLocale()->date($date, $format, null, false);
         $object->setDateFrom($date->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     } else {
         $object->setDateFrom(null);
     }
     if ($date = $object->getDateTo()) {
         $date = Mage::app()->getLocale()->date($date, $format, null, false);
         $object->setDateTo($date->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
     } else {
         $object->setDateTo(null);
     }
     if (!is_null($object->getDateFrom()) && !is_null($object->getDateTo()) && strtotime($object->getDateFrom()) > strtotime($object->getDateTo())) {
         Mage::throwException(Mage::helper('core')->__('Start date can\'t be greater than end date'));
     }
     $check = $this->_checkIntersection($object->getStoreId(), $object->getDateFrom(), $object->getDateTo(), $object->getId());
     if ($check) {
         Mage::throwException(Mage::helper('core')->__('Your design change for the specified store intersects with another one, please specify another date range'));
     }
     if (is_null($object->getDateFrom())) {
         $object->setDateFrom(new Zend_Db_Expr('null'));
     }
     if (is_null($object->getDateTo())) {
         $object->setDateTo(new Zend_Db_Expr('null'));
     }
     parent::_beforeSave($object);
 }
开发者ID:jauderho,项目名称:magento-mirror,代码行数:30,代码来源:Design.php

示例11: _afterDelete

 protected function _afterDelete(Mage_Core_Model_Abstract $object)
 {
     //delete values
     $this->_getReadAdapter()->delete($this->getTable('webforms/results_values'), 'result_id = ' . $object->getId());
     Mage::dispatchEvent('webforms_result_delete', array('result' => $object));
     return parent::_afterDelete($object);
 }
开发者ID:xiaoguizhidao,项目名称:BumblebeeSite,代码行数:7,代码来源:Results.php

示例12: load

 public function load(Mage_Core_Model_Abstract $object, $value, $field = null)
 {
     if (strcmp($value, (int) $value) !== 0) {
         $field = 'post_id';
     }
     return parent::load($object, $value, $field);
 }
开发者ID:macosxvn,项目名称:techheroes,代码行数:7,代码来源:Comment.php

示例13: _afterLoad

 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getData('mapping_serialized')) {
         $object->setMapping(unserialize($object->getData('mapping_serialized')));
     }
     return parent::_afterLoad($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:7,代码来源:Category.php

示例14: load

 public function load(Mage_Core_Model_Abstract $object, $value, $field = null)
 {
     if (!intval($value) && is_string($value)) {
         $field = 'role_id';
     }
     return parent::load($object, $value, $field);
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:7,代码来源:Role.php

示例15: getValueTable

 public function getValueTable($entityName, $valueType)
 {
     if (version_compare(Mage::getVersion(), '1.4.0.0', '>=')) {
         return parent::getValueTable($entityName, $valueType);
     }
     return $this->getTable($entityName) . '_' . $valueType;
 }
开发者ID:Eximagen,项目名称:BulletMagento,代码行数:7,代码来源:Template.php


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