本文整理汇总了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类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: _afterSave
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
parent::_afterSave($object);
$this->_updateGroupDefaultStore($object->getGroupId(), $object->getId());
$this->_changeGroup($object);
return $this;
}
开发者ID:jpbender,项目名称:mage_virtual,代码行数:7,代码来源:Store.php
示例17: _afterSave
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
/** @var Mirasvit_Helpdesk_Model_Status $object */
if (!$object->getIsMassStatus()) {
}
return parent::_afterSave($object);
}
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:7,代码来源:Status.php
示例18: _afterSave
/**
* Perform actions after object save
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Eav_Model_Mysql4_Entity_Attribute_Set
*/
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
if ($object->getGroups()) {
/* @var $group Mage_Eav_Model_Entity_Attribute_Group */
foreach ($object->getGroups() as $group) {
$group->setAttributeSetId($object->getId());
if ($group->itemExists() && !$group->getId()) {
continue;
}
$group->save();
}
}
if ($object->getRemoveGroups()) {
foreach ($object->getRemoveGroups() as $group) {
/* @var $group Mage_Eav_Model_Entity_Attribute_Group */
$group->delete();
}
Mage::getResourceModel('eav/entity_attribute_group')->updateDefaultGroup($object->getId());
}
if ($object->getRemoveAttributes()) {
foreach ($object->getRemoveAttributes() as $attribute) {
/* @var $attribute Mage_Eav_Model_Entity_Attribute */
$attribute->deleteEntity();
}
}
return parent::_afterSave($object);
}
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:33,代码来源:Set.php
示例19: _getLoadSelect
/**
* Retrieve select object for load object data
*
* @param string $field
* @param mixed $value
* @return Zend_Db_Select
*/
protected function _getLoadSelect($field, $value, $object)
{
$select = parent::_getLoadSelect($field, $value, $object);
if ($object->getOrderId()) {
$select->join(array('order_table' => $this->getTable($this->_tableName . '_order')), $this->getMainTable() . '.log_id = order_table.log_id')->where('order_table.order_id IN (?) ', $object->getOrderId())->order('order_id DESC');
}
return $select;
}
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:15,代码来源:Abstract.php
示例20: _afterLoad
/**
* @param Mirasvit_FeedExport_Model_Feed $object
*
* @return $this
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
Mage::helper('feedexport/format')->expandFormat($object);
$object->setCronDay(explode(',', $object->getCronDay()));
$object->setCronTime(explode(',', $object->getCronTime()));
$this->loadRules($object);
return parent::_afterLoad($object);
}
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:13,代码来源:Feed.php
注:本文中的Mage_Core_Model_Mysql4_Abstract类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论