本文整理汇总了PHP中Mage_Core_Model_Abstract::getWebsiteId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::getWebsiteId方法的具体用法?PHP Mage_Core_Model_Abstract::getWebsiteId怎么用?PHP Mage_Core_Model_Abstract::getWebsiteId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Abstract::getWebsiteId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getAlertRow
protected function _getAlertRow(Mage_Core_Model_Abstract $object)
{
if ($object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
$sql = $this->_getWriteAdapter()->select()->from($this->getMainTable())->where('customer_id=?', $object->getCustomerId())->where('product_id=?', $object->getProductId())->where('website_id=?', $object->getWebsiteId());
return $this->_getWriteAdapter()->fetchRow($sql);
}
return false;
}
示例2: _getAlertRow
/**
* Retrieve alert row by object parameters
*
* @param Mage_Core_Model_Abstract $object
* @return array|bool
*/
protected function _getAlertRow(Mage_Core_Model_Abstract $object)
{
$adapter = $this->_getReadAdapter();
if ($object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
$select = $adapter->select()->from($this->getMainTable())->where('customer_id = :customer_id')->where('product_id = :product_id')->where('website_id = :website_id');
$bind = array(':customer_id' => $object->getCustomerId(), ':product_id' => $object->getProductId(), ':website_id' => $object->getWebsiteId());
return $adapter->fetchRow($select, $bind);
}
return false;
}
示例3: _changeWebsite
protected function _changeWebsite(Mage_Core_Model_Abstract $model)
{
if ($model->getOriginalWebsiteId() && $model->getWebsiteId() != $model->getOriginalWebsiteId()) {
$write = $this->_getWriteAdapter();
$groupId = $write->fetchOne($write->select()->from($this->getTable('core/website'), 'default_group_id')->where($write->quoteInto('website_id=?', $model->getOriginalWebsiteId())), 'default_group_id');
if ($groupId == $model->getId()) {
$write->update($this->getTable('core/website'), array('default_group_id' => 0), $write->quoteInto('website_id=?', $model->getOriginalWebsiteId()));
}
}
return $this;
}
示例4: _changeWebsite
/**
* Change store group website
*
* @param Mage_Core_Model_Abstract $model
* @return Mage_Core_Model_Resource_Store_Group
*/
protected function _changeWebsite(Mage_Core_Model_Abstract $model)
{
if ($model->getOriginalWebsiteId() && $model->getWebsiteId() != $model->getOriginalWebsiteId()) {
$select = $this->_getWriteAdapter()->select()->from($this->getTable('core_website'), 'default_group_id')->where('website_id = :website_id');
$groupId = $this->_getWriteAdapter()->fetchOne($select, array('website_id' => $model->getOriginalWebsiteId()));
if ($groupId == $model->getId()) {
$bind = array('default_group_id' => 0);
$where = array('website_id = ?' => $model->getOriginalWebsiteId());
$this->_getWriteAdapter()->update($this->getTable('core_website'), $bind, $where);
}
}
return $this;
}
示例5: _beforeSave
/**
* Before save action
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if (is_null($object->getId()) && $object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
if ($row = $this->_getAlertRow($object)) {
$object->addData($row);
$object->setStatus(0);
}
}
if (is_null($object->getAddDate())) {
$object->setAddDate(Mage::getModel('core/date')->gmtDate());
$object->setStatus(0);
}
return parent::_beforeSave($object);
}
示例6: _afterDelete
/**
* Remove core configuration data after delete website
*
* @param Mage_Core_Model_Abstract $model
* @return Mage_Core_Model_Resource_Website
*/
protected function _afterDelete(Mage_Core_Model_Abstract $model)
{
$where = array('scope = ?' => 'websites', 'scope_id = ?' => $model->getWebsiteId());
$this->_getWriteAdapter()->delete($this->getTable('core/config_data'), $where);
return $this;
}
示例7: _afterDelete
protected function _afterDelete(Mage_Core_Model_Abstract $model)
{
$this->_getWriteAdapter()->delete($this->getTable('core/config_data'), $this->_getWriteAdapter()->quoteInto("scope = 'websites' AND scope_id = ?", $model->getWebsiteId()));
return $this;
}