get all overviews of a config

@param int $configId

@return array
765844
private function getOverviewsOfConfig($configId)
    {
        $configRepository = $this->em->getRepository('KunstmaanDashboardBundle:AnalyticsConfig');
        $segmentRepository = $this->em->getRepository('KunstmaanDashboardBundle:AnalyticsSegment');
        $overviewRepository = $this->em->getRepository('KunstmaanDashboardBundle:AnalyticsOverview');
        // get specified config
        $config = $configRepository->find($configId);

        if (!$config) {
            throw new \Exception('Unkown config ID');
        }

        // create default overviews for this config if none exist yet
        if (!count($config->getOverviews())) {
            $overviewRepository->addOverviews($config);
        }

        // init all the segments for this config
        $segments = $config->getSegments();
        foreach ($segments as $segment) {
            $segmentRepository->initSegment($segment);
        }

        // get the overviews
        return $config->getOverviews();
    }
79101
private function readConfigFile(string $configFilename): array
  {
    $settings = parse_ini_file($configFilename, true);

    $this->constantsFilename = self::getSetting($settings, false, 'constants', 'columns');
    $this->className         = self::getSetting($settings, false, 'constants', 'class');

    return $settings;
  }
1220424
public function getRequiredFiles($config)
    {
        $files = [];
        
        foreach ($config as $key => $name) {
            
            if (is_numeric($key) && is_string($name)) {
                
                $files[] = $name;
                
            } elseif (is_numeric($key) && is_array($name)) {
                
                foreach ($name as $module => $file) {
                    $files[] = sprintf('%s: %s', $module, $file);
                }
                
            } elseif (!is_numeric($key) && is_array($name)) {
                
                foreach ($name as $file) {
                    $files[] = sprintf('%s: %s', $key, $file);
                }
                
            }
            
        }
        
        return $files;
    }
318368
protected function getOptionsFromConfig(Config $config)
    {
        $options = $this->options;

        if ($visibility = $config->get('visibility')) {
            // For local reference
            $options['visibility'] = $visibility;
            // For external reference
            $options['ACL'] = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? 'public-read' : 'private';
        }

        if ($mimetype = $config->get('mimetype')) {
            // For local reference
            $options['mimetype'] = $mimetype;
            // For external reference
            $options['ContentType'] = $mimetype;
        }

        foreach (static::$metaOptions as $option) {
            if ( ! $config->has($option)) {
                continue;
            }
            $options[$option] = $config->get($option);
        }

        return $options;
    }
855933
protected function getConfigArr(string $configAppFile) : array
    {
        $configCoreFile = __DIR__.'/../Config/config.php';
        $configCore = $this->requireFile($configCoreFile);
        $configApp = $this->requireFile($configAppFile);
        
        $services = [];
        $skipCoreServices = $configApp['skipCoreServices'] ?? false;
        if (isset($configCore['services']) && !$skipCoreServices) {
            $services[] = $configCore['services'];
        }
        if (isset($configApp['services'])) {
            $services[] = $configApp['services'];
        }
        $configArr = array_replace_recursive($configCore, $configApp);
        $configArr['services'] = $services;
        
        return $configArr;
    }
1187662
protected function getConfig()
    {
        if (\tao_install_utils_System::isTAOInstalled() && $this->getServiceLocator()->has(common_ext_ExtensionsManager::SERVICE_ID)) {
            $ext = $this->getServiceLocator()
                ->get(common_ext_ExtensionsManager::SERVICE_ID)
                ->getExtensionById('generis');
            $config = $ext->getConfig('passwords');
        } else {
            $config = require_once( __DIR__ . '/../../config/default/passwords.conf.php' );
        }

        return (array) $config['constrains'];
    }
783281
public function getConfig($refresh = false)
    {
        return $this->getCache('plugins-config', $refresh, function () {
            return [
                'wei' => [
                    'aliases' => $this->getWeiAliases(),
                ],
                'app' => [
                    'controllerMap' => $this->getAppControllerMap(),
                ],
                'plugin' => [
                    'pluginClasses' => $this->getPluginClasses(true),
                ],
            ];
        });
    }
257531
public function getAllSubordinates($guid = null, $limit = CAKE_LDAP_SYNC_AD_LIMIT) {
		$result = [];
		$conditions = [];
		$contain = [];
		if (!empty($guid)) {
			$conditions[$this->Employee->alias . '.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID] = $guid;
			$contain[] = 'Employee';
		}
		$fields = [
			$this->alias . '.id',
			$this->alias . '.parent_id',
			$this->alias . '.lft',
			$this->alias . '.rght',
			$this->alias . '.name',
		];
		$order = [
			$this->alias . '.id' => 'asc',
		];
		$result = $this->find('all', compact('fields', 'conditions', 'order', 'limit', 'contain'));

		return $result;
	}
724914
public function findAllForGroup($groupId)
    {
        if (!$groupId) {
            return [];
        }

        if (!is_array($groupId)) {
            $groupId = [$groupId];
        }

        $cacheKey = join('_', $groupId);

        $permissions = Cache::remember($cacheKey, function () use ($groupId) {
            return $this
                ->find('list', [
                    'keyField' => 'path',
                    'valueField' => 'allowed'
                ])
                ->where([
                    'group_id IN' => $groupId,
                    'allowed >' => 0
                ])
                ->order('allowed DESC')
                ->hydrate(false)
                ->toArray();
        }, 'wasabi/core/group_permissions');

        return $permissions;
    }
737095
public function getSettings($index)
    {
        $config = $this->get($index);

        if (null === $config) {
            return null;
        }

        if (!isset($config['settings'])) {
            return [];
        }

        return $config['settings'];
    }
623948
public function safeLoadService($configId)
    {
        /**
         * Inline autoloader that will construct a new class based on ConfigurableService
         * @param string $class_name
         */
        $missingClasses = array();
        
        $fallbackAutoload = function($class_name) use (&$missingClasses) {
            $missingClasses[] = $class_name;
            $split = strrpos($class_name, '\\');
            if ($split == false) {
                $result = eval('class '.$class_name.' extends oat\\oatbox\\service\\ConfigurableService {}');
            } else {
                $namespace = substr($class_name, 0, $split);
                $class = substr($class_name, $split+1);
                eval('namespace '.$namespace.'; '.'class '.$class.' extends \\oat\\oatbox\\service\\ConfigurableService {}');
            }
        };
        $serviceManager = $this->getServiceManager();
        spl_autoload_register($fallbackAutoload);
        $service = $serviceManager->get($configId);
        spl_autoload_unregister($fallbackAutoload);
        
        return $service;
    }
626045
public function characteristicsReadItems($gid) {
    $query = $this->connection->select('site_commerce_characteristics_item_index', 'n');
    $query->fields('n', array('cid'));
    $query->condition('n.gid', $gid);
    $query->join('site_commerce_characteristics_item', 'i', 'n.cid = i.cid');
    $query->fields('i', array('title'));
    $loadItems = $query->execute()->fetchAllKeyed();

    return $loadItems;
  }
254342
public function getConfig()
    {
        $config = [];

        $config['general'] = $this->parseGeneral();
        $config['taxonomy'] = $this->parseTaxonomy();
        $config['contenttypes'] = $this->parseContentTypes($config['general']);
        $config['menu'] = $this->parseConfigYaml('menu.yml');
        $config['routing'] = $this->parseConfigYaml('routing.yml');
        $config['permissions'] = $this->parseConfigYaml('permissions.yml');
        $config['extensions'] = $this->parseConfigYaml('extensions.yml');

        return $config;
    }
149916
private function massageConfig(array $config, string $configPath) : array
    {
        if (!isset($config['installed_paths'])) {
            return $config;
        }

        $config['installed_paths'] = implode(',', array_map(function ($path) use ($configPath) {
            return dirname($configPath) . '/' . $path;
        }, explode(',', $config['installed_paths'])));

        return $config;
    }
1179842
private function getConfigsForUriTemplates($config)
    {
        $configs = [$config];

        if ($config['additionalBindings']) {
            foreach ($config['additionalBindings'] as $additionalBinding) {
                $configs[] = $additionalBinding + $config;
            }
        }

        return $configs;
    }
405181
protected function _getConfigSet()
    {

        if (empty($_SERVER) && empty($GLOBALS['argv'])) {
            return [];
        }

        // default config for all of them
        $_config_set = array();
        $host_id     = $this->get('host_id');

        /**
         * if there's a specific port remove the port
         *
         * @todo keep in mind that maybe someone needs a port specific behaviour for his app
         */
        if (($pos = strpos((string)$host_id, ':')) !== false) {
            $this->mainNode->addChild(new Node($this->mainNode, 'host_id', ( string )substr($host_id, 0, $pos)));
        }


        // split up the server host_id to an array
        $id_part_list = (array)explode(self::CONFIG_DELIMITER, $host_id);
        if (count($id_part_list) < 3) {
            array_unshift($id_part_list, self::HIERACHY_PLACEHOLDER);
        }

        // add an extra iteration so there is a specific config for a subdomain
        // and a generic one for all subdomains in this toplevel domain
        $count = (int)count($id_part_list) + 1;
        $i     = 0;


        // we don't need to rebuild this standard strings all the time
        $config_del = self::HIERACHY_PLACEHOLDER . ( string )self::CONFIG_DELIMITER;
        $extension  = self::CONFIG_DELIMITER . self::FILE_EXTENSION;

        // the first config is the current host id + .cfg
        $self = (string)$this->config_path . '/' . (string)implode(self::CONFIG_DELIMITER, $id_part_list) . (string)$extension;

        do {
            // shift the first position of the array
            array_shift($id_part_list);

            // if the file exists add it to the "to be parsed list"
            if (file_exists($self) && !in_array($self, $_config_set)) {
                $_config_set [] = (string)$self;
            }

            $file_name = (string)(count($id_part_list) > 0 ? implode(self::CONFIG_DELIMITER, $id_part_list) . (string)$extension : self::FILE_EXTENSION);
            $self      = (string)$this->config_path . '/' . (string)$config_del . $file_name;
            ++$i;
        } while ($i < $count);

        /**
         * Config sort algorithm
         *
         * lambda function for sorting
         *
         * @param $a string
         * @param $b string
         *
         * @return int
         */
        uasort($_config_set, function ($a, $b) {
            // include to the normal namespace

            if (substr_count($a, self::CONFIG_DELIMITER) == substr_count($a, self::CONFIG_DELIMITER)) {
                if (strpos($a, self::HIERACHY_PLACEHOLDER) == true && strpos($b, self::HIERACHY_PLACEHOLDER) == false) {
                    return -1;
                } elseif (strpos($a, self::HIERACHY_PLACEHOLDER) == false && strpos($b, self::HIERACHY_PLACEHOLDER) == true) {
                    return 1;
                }

                return 0;
            }

            return (substr_count($a, self::CONFIG_DELIMITER) > substr_count($b, self::CONFIG_DELIMITER) ? -1 : 1);
        });

        return $_config_set;
    }
933264
public static function getList($pkgID = null)
    {
        $db = Database::connection();
        $queryBuilder = $db->createQueryBuilder()
            ->select('e.*')
            ->from('ConversationEditors', 'e')
            ->orderBy('cnvEditorHandle', 'asc');
        if ($pkgID !== null) {
            $queryBuilder->andWhere('e.pkgID = :pkgID')->setParameter('pkgID', $pkgID);
        }

        $cnvEditors = $db->fetchAll($queryBuilder->getSQL(), $queryBuilder->getParameters());
        $editors = array();
        foreach ($cnvEditors as $editorRecord) {
            $cnvEditor = static::createFromRecord($editorRecord);
            $editors[] = $cnvEditor;
        }

        return $editors;
    }