Sitewards_B2BProfessional_Helper_Core   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getStoreFlag() 0 4 1
A getStoreConfig() 0 7 2
1
<?php
2
3
/**
4
 * Sitewards_B2BProfessional_Helper_Core
5
 *
6
 * @category    Sitewards
7
 * @package     Sitewards_B2BProfessional
8
 * @copyright   Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
9
 */
10
class Sitewards_B2BProfessional_Helper_Core extends Mage_Core_Helper_Abstract
11
{
12
    /**
13
     * Get a store flag value and set to against the object
14
     *
15
     * @param string $sStoreFlagPath
16
     * @param string $sStoreFlagAttribute
17
     * @return bool
18
     */
19
    public function getStoreFlag($sStoreFlagPath, $sStoreFlagAttribute)
20
    {
21
        return (bool)$this->getStoreConfig($sStoreFlagPath, $sStoreFlagAttribute);
22
    }
23
24
    /**
25
     * Get a store config value and set against the object
26
     *
27
     * @param string $sStoreConfigPath
28
     * @param string $sStoreConfigAttribute
29
     * @return string
30
     */
31
    public function getStoreConfig($sStoreConfigPath, $sStoreConfigAttribute)
32
    {
33
        if ($this->$sStoreConfigAttribute === null) {
34
            $this->$sStoreConfigAttribute = Mage::getStoreConfig($sStoreConfigPath);
35
        }
36
        return $this->$sStoreConfigAttribute;
37
    }
38
}