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


PHP Mage_Newsletter_Model_Queue::getStores方法代码示例

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


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

示例1: setStores

 public function setStores(Mage_Newsletter_Model_Queue $queue)
 {
     $this->_getWriteAdapter()->delete($this->getTable('queue_store_link'), $this->_getWriteAdapter()->quoteInto('queue_id = ?', $queue->getId()));
     if (!is_array($queue->getStores())) {
         $stores = array();
     } else {
         $stores = $queue->getStores();
     }
     foreach ($stores as $storeId) {
         $data = array();
         $data['store_id'] = $storeId;
         $data['queue_id'] = $queue->getId();
         $this->_getWriteAdapter()->insert($this->getTable('queue_store_link'), $data);
     }
     $this->removeSubscribersFromQueue($queue);
     if (count($stores) == 0) {
         return $this;
     }
     $subscribers = Mage::getResourceSingleton('newsletter/subscriber_collection')->addFieldToFilter('store_id', array('in' => $stores))->useOnlySubscribed()->load();
     $subscriberIds = array();
     foreach ($subscribers as $subscriber) {
         $subscriberIds[] = $subscriber->getId();
     }
     if (count($subscriberIds) > 0) {
         $this->addSubscribersToQueue($queue, $subscriberIds);
     }
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:28,代码来源:Queue.php

示例2: newsletterQueueSaveBefore

 /**
  * Limit newsletter queue save
  *
  * @param Mage_Newsletter_Model_Queue $model
  */
 public function newsletterQueueSaveBefore($model)
 {
     // force to assign to SV
     $storeIds = $model->getStores();
     if (!$storeIds || !$this->_role->hasStoreAccess($storeIds)) {
         Mage::throwException(Mage::helper('enterprise_admingws')->__('Please assign this entity to a store view.'));
     }
     // make sure disallowed store ids won't be modified
     $originalStores = $model->getResource()->getStores($model);
     $model->setStores($this->_updateSavingStoreIds($storeIds, $originalStores));
 }
开发者ID:beejhuff,项目名称:magento-1.13.0.2,代码行数:16,代码来源:Models.php


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