public function testGetStoreIds() { $this->assertEquals(array(1 => 1), $this->_model->getStoreIds()); }
/** * Check if it possible to copy into store "store_to" * * @param Mage_Core_Model_Website $website * @param array $storeData * @return \Mage_Catalog_Model_Api2_Product_Website_Validator_Admin_Website */ protected function _checkStoreTo($website, $storeData) { if (!isset($storeData['store_to']) || !is_numeric($storeData['store_to'])) { $this->_addError(sprintf('Invalid value for "store_to" for the website with ID #%d.', $website->getId())); return $this; } // Check if the store with the specified ID (to which we will copy the information) exists // and if it belongs to the website being added $storeTo = Mage::getModel('core/store')->load($storeData['store_to']); if (!$storeTo->getId()) { $this->_addError(sprintf('Store not found #%d for website #%d.', $storeData['store_to'], $website->getId())); return $this; } if (!in_array($storeTo->getId(), $website->getStoreIds())) { $this->_addError(sprintf('Store #%d to which we will copy the information does not belong' . ' to the website #%d being added.', $storeTo->getId(), $website->getId())); } return $this; }
/** * get quotes to import * * @param Mage_Core_Model_Website $website * @param int $limit * @param $modified * * @return mixed */ private function _getQuoteToImport(Mage_Core_Model_Website $website, $limit = 100, $modified = false) { $collection = $this->getCollection()->addFieldToFilter('store_id', array('in' => $website->getStoreIds()))->addFieldToFilter('customer_id', array('notnull' => true)); if ($modified) { $collection->addFieldToFilter('modified', 1)->addFieldToFilter('imported', 1); } else { $collection->addFieldToFilter('imported', array('null' => true)); } $collection->getSelect()->limit($limit); return $collection; }
private function _getReviewsToExport(Mage_Core_Model_Website $website, $limit = 100) { return $this->getCollection()->addFieldToFilter('review_imported', array('null' => 'true'))->addFieldToFilter('store_id', array('in' => $website->getStoreIds()))->setPageSize($limit); }
private function _getModifiedWishlistToImport(Mage_Core_Model_Website $website, $limit = 100) { $collection = $this->getCollection()->addFieldToFilter('wishlist_modified', 1)->addFieldToFilter('store_id', array('in' => $website->getStoreIds())); $collection->getSelect()->limit($limit); return $collection; }