Current file: htdocs/app/code/core/Mage/CatalogIndex/Model/Mysql4/Setup.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 3 CRAP
0.00%0.00%
0.00% 0 / 19
 
Mage_CatalogIndex_Model_Mysql4_Setup
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 3
0.00%0.00%
0.00% 0 / 19
 convertStoreToWebsite($table)
0.00%0.00%
0.00% 0 / 1 6
0.00%0.00%
0.00% 0 / 5
 _getStoreToWebsiteAssignments()
0.00%0.00%
0.00% 0 / 1 12
0.00%0.00%
0.00% 0 / 8
 _setWebsiteInfo($table, $websiteId, $storeIds)
0.00%0.00%
0.00% 0 / 1 2
0.00%0.00%
0.00% 0 / 6


       1                 : <?php                                                                                      
       2                 : /**                                                                                        
       3                 :  * Magento                                                                                 
       4                 :  *                                                                                         
       5                 :  * NOTICE OF LICENSE                                                                       
       6                 :  *                                                                                         
       7                 :  * This source file is subject to the Open Software License (OSL 3.0)                      
       8                 :  * that is bundled with this package in the file LICENSE.txt.                              
       9                 :  * It is also available through the world-wide-web at this URL:                            
      10                 :  * http://opensource.org/licenses/osl-3.0.php                                              
      11                 :  * If you did not receive a copy of the license and are unable to                          
      12                 :  * obtain it through the world-wide-web, please send an email                              
      13                 :  * to license@magentocommerce.com so we can send you a copy immediately.                   
      14                 :  *                                                                                         
      15                 :  * DISCLAIMER                                                                              
      16                 :  *                                                                                         
      17                 :  * Do not edit or add to this file if you wish to upgrade Magento to newer                 
      18                 :  * versions in the future. If you wish to customize Magento for your                       
      19                 :  * needs please refer to http://www.magentocommerce.com for more information.              
      20                 :  *                                                                                         
      21                 :  * @category    Mage                                                                       
      22                 :  * @package     Mage_CatalogIndex                                                          
      23                 :  * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)           
      24                 :  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
      25                 :  */                                                                                        
      26                 :                                                                                            
      27                 : class Mage_CatalogIndex_Model_Mysql4_Setup extends Mage_Core_Model_Resource_Setup          
      28                 : {                                                                                          
      29                 :     protected $_storeToWebsite = null;                                                     
      30                 :                                                                                            
      31                 :     public function convertStoreToWebsite($table)                                          
      32                 :     {                                                                                      
      33               0 :         $assignment = $this->_getStoreToWebsiteAssignments();                              
      34               0 :         foreach ($assignment as $website=>$stores) {                                       
      35               0 :             $this->_setWebsiteInfo($table, $website, $stores);                             
      36               0 :         }                                                                                  
      37               0 :         return $this;                                                                      
      38                 :     }                                                                                      
      39                 :                                                                                            
      40                 :     protected function _getStoreToWebsiteAssignments()                                     
      41                 :     {                                                                                      
      42               0 :         if (is_null($this->_storeToWebsite)) {                                             
      43               0 :             $this->_storeToWebsite = array();                                              
      44               0 :             $websiteCollection = Mage::getModel('core/website')->getCollection();          
      45               0 :             foreach ($websiteCollection as $website) {                                     
      46               0 :                 $this->_storeToWebsite[$website->getId()] = $website->getStoreIds();       
      47               0 :             }                                                                              
      48               0 :         }                                                                                  
      49                 :                                                                                            
      50               0 :         return $this->_storeToWebsite;                                                     
      51                 :     }                                                                                      
      52                 :                                                                                            
      53                 :     protected function _setWebsiteInfo($table, $websiteId, $storeIds)                      
      54                 :     {                                                                                      
      55               0 :         $this->getConnection()->update(                                                    
      56               0 :             $table,                                                                        
      57               0 :             array('website_id'=>$websiteId),                                               
      58               0 :             $this->getConnection()->quoteInto('store_id IN (?)', $storeIds)                
      59               0 :         );                                                                                 
      60                 :                                                                                            
      61               0 :         return $this;                                                                      
      62                 :     }                                                                                      
      63                 : }                                                                                          

Generated by PHP_CodeCoverage 1.0.4 using PHP 5.3.4 and PHPUnit 3.5.13 at Tue Jul 5 9:07:16 UTC 2011.