本文整理汇总了PHP中Mage_Core_Model_Abstract::setStoreIds方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::setStoreIds方法的具体用法?PHP Mage_Core_Model_Abstract::setStoreIds怎么用?PHP Mage_Core_Model_Abstract::setStoreIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Abstract::setStoreIds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterLoad
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
if ($object->getStoreIds()) {
$object->setStoreIds(explode(',', $object->getStoreIds()));
} else {
$object->setStoreIds(array(0));
}
return parent::_afterLoad($object);
}
示例2: _afterLoad
/**
* @param Mage_Core_Model_Abstract $object
*
* @return $this|Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
if (strlen($object->getStoreIds()) > 0) {
$object->setStoreIds(array_map('intval', explode(',', $object->getStoreIds())));
} else {
$object->setStoreIds(array());
}
return parent::_afterLoad($object);
}
示例3: _beforeSave
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if (is_array($object->getStoreIds())) {
$object->setStoreIds(implode(',', $object->getStoreIds()));
}
if (is_array($object->getCustomerGroups())) {
$object->setCustomerGroups(implode(',', $object->getCustomerGroups()));
}
}
示例4: _afterLoad
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
$productIds = '';
if ($object->getId()) {
if (!is_array($object->getStoreIds())) {
$object->setStoreIds(explode(',', $object->getStoreIds()));
}
$groups = $object->getCustomerGroups();
if ($groups) {
$object->setCustomerGroups(explode(',', $groups));
}
$product = Mage::getResourceSingleton('downloads/relation')->getProductIds($object->getId());
if ($product) {
$productIds = implode(',', $product);
}
$object->setInProducts($productIds);
}
return parent::_afterLoad($object);
}