MageConfigSync\Magento\ConfigurationAdapter::getAllValues PHP Method

getAllValues() public method

public getAllValues ( ) : array
return array
    public function getAllValues()
    {
        $read = $this->_magento->getDatabaseReadAdapter();
        $query = $read->select()->from($this->_table_name, array('scope', 'scope_id', 'path', 'value'));
        return $read->fetchAll($query);
    }

Usage Example

Beispiel #1
0
 /**
  * @param ConfigurationAdapter $config_adapter
  * @param bool $environment
  * @return ConfigYaml
  */
 public static function build(ConfigurationAdapter $config_adapter, $environment = false)
 {
     $data_structure = array();
     foreach ($config_adapter->getAllValues() as $row) {
         $scope = $row['scope'];
         $scope_id = $row['scope_id'];
         $path = $row['path'];
         $value = $row['value'];
         $scope_key = self::buildScopeKey($scope, $scope_id);
         if (!isset($data_structure[$scope_key])) {
             $data_structure[$scope_key] = array();
         }
         $data_structure[$scope_key][$path] = $value;
     }
     return new ConfigYaml($data_structure, $environment);
 }