Gc\Core\Config::getValue PHP Method

getValue() public method

Get config value
public getValue ( string $data, string $field = 'identifier' ) : string
$data string Data
$field string Optional database field, by default 'identifier'
return string value
    public function getValue($data, $field = 'identifier')
    {
        $row = $this->fetchRow($this->select(array($field => $data)));
        if (!empty($row)) {
            return $row['value'];
        }
        return null;
    }

Usage Example

Example #1
0
 /**
  * Constructor
  *
  * @param CoreConfig $configTable Config table
  */
 public function __construct(CoreConfig $configTable = null)
 {
     if ($configTable === null) {
         throw new Exception('Invalid parameter, $config must be an instance of \\Gc\\Core\\Config');
     }
     $this->configTable = $configTable;
     $config = @unserialize($this->configTable->getValue('module_addthis'));
     $this->config = array_merge($this->defaultOptions, $config ? $config : array());
     parent::__construct();
 }
All Usage Examples Of Gc\Core\Config::getValue