The method generateList returns an array of list for given column
@param array $config
@return array - array of values.
336220
public static function generateList( $config = [] ) {

		$modelClass	= static::$modelClass;
		$modelTable = $modelClass::tableName();

		// Query and Column
		$query	= new Query();
		$column	= $config[ 'column' ] ?? 'id';

		// Conditions, Filters and Sorting
		$conditions	= $config[ 'conditions' ] ?? null;
		$filters	= $config[ 'filters' ] ?? null;
		$order		= $config[ 'order' ] ?? null;

		// Conditions ----------

		$query->select( $column )->from( $modelTable );

		if( isset( $conditions ) ) {

			foreach ( $conditions as $ckey => $condition ) {

				if( is_numeric( $ckey ) ) {

					$query->andWhere( $condition );

					unset( $conditions[ $ckey ] );
				}
			}

			$query->andWhere( $conditions );
		}

		$interfaces = class_implements( static::class );

		if( isset( $interfaces[ 'cmsgears\core\common\services\interfaces\base\IApproval' ] ) ) {

			$statusFilter = $modelClass::STATUS_TERMINATED;

			$query->andWhere( "$modelTable.status<$statusFilter" );
		}

		// Filters -------------

		if( isset( $filters ) ) {

			foreach ( $filters as $filter ) {

				$query	= $query->andFilterWhere( $filter );
			}
		}

		// Sorting -------------

		if( isset( $order ) ) {

			$query->orderBy( $order );
		}

		// Quering -------------

		// Get column
		$query->column();

		// Create command
		$command	= $query->createCommand();

		// Execute the command
		$list		= $command->queryAll();
		$resultList	= [];

		// Result --------------

		foreach ( $list as $item ) {

			$resultList[] = $item[ $column ];
		}

		return $resultList;
	}
86807
public function getFileList($config)
    {
        if (strpos($config, ',')) {
            return array_filter(explode(',', $config));
        }

        if (!$this->isAbsolutePath($config)) {
            $config = getcwd().'/'.$config;
        }

        if (!file_exists($config)) {
            throw new InvalidArgumentException(sprintf('Configuration file "%s" does not exist.', $config));
        }

        $result = require $config;

        if ($result instanceof Config) {
            return $result->getFilenames();
        }

        if (is_array($result)) {
            return $result;
        }

        throw new InvalidArgumentException('Config must return an array of filenames or a Config object.');
    }
401729
protected function getRequestConfig(array $config) : array
    {
        if (!empty($this->defaultRequestOptions)) {
            $config = array_replace_recursive($this->defaultRequestOptions, $config);
        }

        return $config;
    }
1082842
private function writerCollection(array $config)
    {
        if (!empty($config['writers'])) {
            $writers = 0;
            foreach ($config['writers'] as $writer) {
                if ($writer['enabled']) {
                    $this->writerAdapter( $writer );
                    $writers ++;
                }
            }

            return $writers;
        }
    }
261935
public static function getPanelNames(array $config) : array
    {
        if (empty($config[self::PANELS])) {
            return [];
        }

        return array_keys($config[self::PANELS]);
    }
1109087
private function getMergedConfigValues(array $config)
    {
        $mergedConfig = array();

        foreach ($config as $paymentConfig) {
            $mergedConfig[$paymentConfig->getName()] = $paymentConfig->getValue();
        }

        return $mergedConfig;
    }
1155939
protected function prepareConfig(array $config)
    {
        $config = new Config($config);
        $config->setFallback($this->getConfig());

        return $config;
    }
137948
public function getIdList( $config = [] ) {

		$modelClass	= static::$modelClass;
		$modelTable	= $this->getModelTable();

		$config[ 'conditions' ][ "$modelTable.type" ] = static::$parentType;

		return parent::getIdList( $config );
	}
228576
public function getTemplate(array $config)
	{
		foreach ($this->templateGenerators as $type => $generator)
		{
			if (isset($config[$type]))
			{
				return $generator->getTemplate($config[$type]);
			}
		}

		return '';
	}
893312
public function transform(string $config = ''): array
    {
        $parsed = [];
        if (!empty($config)) {
            $decoded = @\json_decode($config, true, 512);
            $parsed = $decoded !== null ? $decoded : [];
        }
        return $parsed;
    }
948438
public function listReleased(array $config = [])
    {
        try {
            return $this->privateListReleased($config);
        } catch (\Exception $e) {
            if ($e instanceof RequestException) {
                /*
                 * ListReleased and List return 404 error if no results are found, even for successful API calls,
                 * So if result status is 404, transform to 200 with empty results.
                 */
                /** @var ResponseInterface $response */
                $response = $e->getResponse();
                if (strval($response->getStatusCode()) === '404') {
                    return [
                        'statusCode' => 200,
                        'list' => [
                            'meta' => [
                                'totalCount' => 0
                            ]
                        ],
                        'elements' => []
                    ];
                }
                throw $e;
            } else {
                throw $e;
            }
        }
    }
407487
public function transform(string $config = ''): array
    {
        $parsed = [];

        if (!\extension_loaded('php_yaml')) {
            return $parsed;
        }
        if (!empty($config)) {
            $parsed = \yaml_parse($config);
            $parsed = $parsed !== null ? $parsed : [];
        }

        return $parsed;
    }
320392
protected function normalizeConfig(array $config)
    {
        $final = [];
        foreach ($config as $key => $value) {
            if (is_array($value)) {
                $final[$key] = $this->normalizeConfig($value);
            } else {
                $final[$value] = [];
            }
        }

        return $final;
    }
41237
public static function generateNameValueList( $config = [] ) {

		$config = static::applySiteFilters( $config );

		$modelClass	= static::$modelClass;
		$modelTable = $modelClass::tableName();

		// map columns
		$nameColumn		= $config[ 'nameColumn' ] ?? 'name';
		$valueColumn	= $config[ 'valueColumn' ] ?? 'value';

		// column alias
		$nameAlias		= $config[ 'nameAlias' ] ?? 'name';
		$valueAlias		= $config[ 'valueAlias' ] ?? 'value';

		// limit
		$limit			= $config[ 'limit' ] ?? 0;

		// Query
		$query = $config[ 'query' ] ?? new Query();

		// Conditions, Filters and Sorting
		$conditions	= $config[ 'conditions' ] ?? null;
		$filters	= $config[ 'filters' ] ?? null;
		$order		= $config[ 'order' ] ?? null;

		// additional data
		$prepend		= $config[ 'prepend' ] ?? [];
		$append			= $config[ 'append' ] ?? [];

		// Conditions ----------

		$query->select( [ "$nameColumn as $nameAlias", "$valueColumn as $valueAlias" ] )
			  ->from( $modelTable );

		if( isset( $conditions ) ) {

			foreach( $conditions as $ckey => $condition ) {

				if( is_numeric( $ckey ) ) {

					$query->andWhere( $condition );

					unset( $conditions[ $ckey ] );
				}
			}

			$query->andWhere( $conditions );
		}

		$interfaces = class_implements( static::class );

		if( isset( $interfaces[ 'cmsgears\core\common\services\interfaces\base\IApproval' ] ) ) {

			$statusFilter = $modelClass::STATUS_TERMINATED;

			$query->andWhere( "$modelTable.status<$statusFilter" );
		}

		// Filters -------------

		if( isset( $filters ) ) {

			foreach( $filters as $filter ) {

				$query = $query->andFilterWhere( $filter );
			}
		}

		// Sorting -------------

		if( isset( $order ) ) {

			$query->orderBy( $order );
		}

		// Limit ---------------

		if( $limit > 0 ) {

			$query->limit( $limit );
		}

		// Quering -------------

		// Create command
		$command = $query->createCommand();

		// Execute the command
		$arrayList = $command->queryAll();

		// Result --------------

		// Prepend given list
		if( count( $prepend ) > 0 ) {

			$arrayList = ArrayHelper::merge( $prepend, $arrayList );
		}

		// Append given list
		if( count( $append ) > 0 ) {

			$arrayList = ArrayHelper::merge( $arrayList, $append );
		}

		return $arrayList;
	}
1057933
protected function createPartOfStructure(array $config)
  {
    $return_properties    = array();
    $return_configuration = array();

    foreach ($config as $configuration)
    {
      $value = null;
      switch ($configuration->getType())
      {
        case TypeEnum::COLLECTION_TYPE:
          $value = array($this->createPartOfStructure($configuration->getChildren()));
          break;
        case TypeEnum::OBJECT_TYPE:
          $value = $this->createPartOfStructure($configuration->getChildren());
          break;
        case TypeEnum::ARRAY_TYPE:
          $value = array();
          break;
        default:
          break;
      }
      $this->modifyConfiguration($configuration);
      $parameter = new Parameter($configuration->getKey(), $value);

      $return_properties[$configuration->getKey()]    = $parameter;
      $return_configuration[$configuration->getKey()] = $configuration;
    }

    return $this->classBuilder->build('\stdClass', $return_configuration, $return_properties);
  }
1081956
public static function createFromConfig(array $config)
    {
        $fields = [];
        foreach ($config as $name => $field) {
            $fields[$name] = Fields::create($name, $field);
        }
        return new static($fields);
    }
175079
protected function createJsonResponse(array $data, array $config)
    {
        if (! \is_null($uses = $config['uses'] ?? null)) {
            $data = $data[$uses] ?? [];
        }

        if ($data instanceof Arrayable) {
            $data = $data->toArray();
        }

        $data = \array_map([$this, 'transformToArray'], $data);

        return function () use ($data, $config) {
            return \json_encode($data, $config['encoding'] ?? 0);
        };
    }