Current file: htdocs/app/code/core/Mage/Core/Model/Mysql4/Store/Group/Collection.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
0.00%0.00%
0.00% 0 / 1
28.57%28.57%
28.57% 2 / 7 CRAP
38.89%38.89%
38.89% 7 / 18
 
Mage_Core_Model_Mysql4_Store_Group_Collection
0.00%0.00%
0.00% 0 / 1
28.57%28.57%
28.57% 2 / 7
38.89%38.89%
38.89% 7 / 18
 _construct()
100.00%100.00%
100.00% 1 / 1 1
100.00%100.00%
100.00% 2 / 2
 load($printQuery = false, $logQuery = false)
0.00%0.00%
0.00% 0 / 1 2.26
60.00%60.00%
60.00% 3 / 5
 setLoadDefault($loadDefault)
100.00%100.00%
100.00% 1 / 1 1
100.00%100.00%
100.00% 2 / 2
 getLoadDefault()
0.00%0.00%
0.00% 0 / 1 2
0.00%0.00%
0.00% 0 / 1
 setWithoutDefaultFilter()
0.00%0.00%
0.00% 0 / 1 2
0.00%0.00%
0.00% 0 / 2
 toOptionArray()
0.00%0.00%
0.00% 0 / 1 2
0.00%0.00%
0.00% 0 / 1
 addWebsiteFilter($website)
0.00%0.00%
0.00% 0 / 1 6
0.00%0.00%
0.00% 0 / 5


       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_Core                                                                             
      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                 : /**                                                                                                   
      28                 :  * Store group collection                                                                             
      29                 :  *                                                                                                    
      30                 :  * @category   Mage                                                                                   
      31                 :  * @package    Mage_Core                                                                              
      32                 :  * @author      Magento Core Team <core@magentocommerce.com>                                          
      33                 :  */                                                                                                   
      34                 :                                                                                                       
      35                 : class Mage_Core_Model_Mysql4_Store_Group_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
      36                 : {                                                                                                     
      37                 :     protected $_loadDefault = false;                                                                  
      38                 :                                                                                                       
      39                 :     protected function _construct()                                                                   
      40                 :     {                                                                                                 
      41              15 :         $this->_init('core/store_group');                                                             
      42              15 :     }                                                                                                 
      43                 :                                                                                                       
      44                 :     public function load($printQuery = false, $logQuery = false)                                      
      45                 :     {                                                                                                 
      46              15 :         if (!$this->_loadDefault) {                                                                   
      47               0 :             $this->setWithoutDefaultFilter();                                                         
      48               0 :         }                                                                                             
      49              15 :         $this->addOrder('main_table.name', 'ASC');                                                    
      50              15 :         return parent::load($printQuery, $logQuery);                                                  
      51                 :     }                                                                                                 
      52                 :                                                                                                       
      53                 :     public function setLoadDefault($loadDefault)                                                      
      54                 :     {                                                                                                 
      55              15 :         $this->_loadDefault = (bool)$loadDefault;                                                     
      56              15 :         return $this;                                                                                 
      57                 :     }                                                                                                 
      58                 :                                                                                                       
      59                 :     public function getLoadDefault()                                                                  
      60                 :     {                                                                                                 
      61               0 :         return $this->_loadDefault;                                                                   
      62                 :     }                                                                                                 
      63                 :                                                                                                       
      64                 :     public function setWithoutDefaultFilter()                                                         
      65                 :     {                                                                                                 
      66               0 :         $this->getSelect()->where($this->getConnection()->quoteInto('main_table.group_id>?', 0));     
      67               0 :         return $this;                                                                                 
      68                 :     }                                                                                                 
      69                 :                                                                                                       
      70                 :     public function toOptionArray()                                                                   
      71                 :     {                                                                                                 
      72               0 :         return $this->_toOptionArray('group_id', 'name');                                             
      73                 :     }                                                                                                 
      74                 :                                                                                                       
      75                 :     public function addWebsiteFilter($website)                                                        
      76                 :     {                                                                                                 
      77               0 :         if (is_array($website)) {                                                                     
      78               0 :             $condition = $this->getConnection()->quoteInto('main_table.website_id IN(?)', $website);  
      79               0 :         }                                                                                             
      80                 :         else {                                                                                        
      81               0 :             $condition = $this->getConnection()->quoteInto('main_table.website_id=?', $website);      
      82                 :         }                                                                                             
      83               0 :         return $this->addFilter('website_id', $condition, 'string');                                  
      84                 :     }                                                                                                 
      85                 : }                                                                                                     

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.