Fetches a variable group and returns it as an associative array.

@since 5.0 takes injected settings into account
@since 5.0 does not return the array by reference anymore
@param string $blockName
@return array
429093
function group( $blockName )
    {
        if ( !isset( $this->BlockValues[$blockName] ) )
        {
            eZDebug::writeError( "Unknown group: '$blockName'", __METHOD__ );
            $ret = null;
            return $ret;
        }
        if ( isset( self::$injectedSettings[$this->FileName][$blockName] ) )
        {
            $ret = array_merge(
                $this->BlockValues[$blockName],
                self::$injectedSettings[$this->FileName][$blockName]
            );
        }
        else
        {
            $ret = $this->BlockValues[$blockName];
        }

        return $ret;
    }
167422
public function getVariables($group)
    {
        $encodedValues = $this->getEnvironmentVariable($group);

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

        return $this->decode($encodedValues);
    }
1026464
public function getBlocks()
    {
        $ungroupedKey = 'Ungrouped';
        $blockGroups = array();
        foreach ($this->blockManagersItems as $blockManagerItem) {

            if ($blockManagerItem->getBlockManager()->getIsInternalBlock()) {
                continue;
            }

            $groups = array($ungroupedKey);
            $group = $blockManagerItem->getGroup();
            if ($group != "") {
                $groups = explode(",", $group);
                if ($group != "redkitecms_internals" && count($groups) == 1) {
                    $groups = array($ungroupedKey);
                }
            }

            $blockGroup = array($blockManagerItem->getType() => array('description' => $blockManagerItem->getDescription(), 'filter' => $blockManagerItem->getFilter()));
            foreach (array_reverse($groups) as $key) {
               $blockGroup = array(trim($key) => $blockGroup);
            }
            $blockGroups = array_merge_recursive($blockGroups, $blockGroup);
        }

        // First displayed group
        $redKiteBlocks = array("Base" => $this->extractGroup('redkitecms_internals', $blockGroups));
        // Last displayed group
        $notGrouped = $this->extractGroup($ungroupedKey, $blockGroups);
        // Sorts
        $this->recurKsort($redKiteBlocks);
        if (count($notGrouped) > 0) {
            $this->recurKsort($notGrouped);
        }

        // Exstracts and sorts all other groups
        $blocks = array();
        foreach ($blockGroups as $blockGroup) {
            $blocks = array_merge($blocks, $blockGroup);
        }
        $this->recurKsort($blocks);

        // Merges blocks
        $blocks = array_merge($redKiteBlocks, $blocks);
        if ( ! empty($notGrouped)) {
            $blocks = array_merge($blocks, array($ungroupedKey => $notGrouped));
        }

        return $blocks;
    }
902796
public function blockJson($blockName, $options = [])
    {
        if (array_key_exists('returnAll', $options) && $options['returnAll']) {
            unset($options['returnAll']);
            $blocksData = [];
            $themeId = ($theme = Theme::where('theme', '=', $this->theme)->first()) ? $theme->id : 0;
            $template = Template::preload($this->template);
            $categoryBlocks = ThemeTemplate::templateBlocks($themeId, $template->exists ? $template->id : null);
            foreach ($categoryBlocks as $blockCategory => $blocks) {
                foreach ($blocks as $block) {
                    $blocksData += json_decode($this->blockJson($block->name, $options), true);
                }
            }
            return collect($blocksData)->toJson();
        }
        return $this->_block($blockName, $options, 'toJson');
    }
1067969
public function getBlockByName($name) {
		foreach($this->blockManifest as $block) {
			if($block->getName() == $name) {
				return $block;
			}
		}
		return false;
	}
845609
protected function getProviderService($blockName)
    {
        /** @var Config $config */
        $config = $this->configRepository->findOne(['name' => $blockName]);

        if (empty($config)) {
            return new DataProviderNoop();
        }
        $serviceName = $config->getDataProvider();

        if (empty($serviceName)) {
            return new DataProviderNoop();
        }

        return $this->container->get($serviceName);
    }
393868
private function extractField($blocks)
    {
        $fieldData = array();

        $pattern = "/([a-zA-Z]+) *(.+)/";

        foreach ($blocks as $block) {
            $match = preg_match($pattern, $block, $matches);

            // A full double string match found
            if (count($matches) == 3) {
                $docLabel = trim(strtolower($matches[1]));
                $docValue = trim($matches[2]);

                if (in_array($docLabel, self::$VALID_EXPRESSIONS)) {
                    $fieldData[self::$VALID_EXPRESSIONS_NAMES[$docLabel]] = $docValue;
                }
            }
        }

        return $fieldData;
    }
714618
public function getGroup($groupName, $file = null, $siteaccess = null)
    {
        if ($file === null && $siteaccess === null) {
            // in this case we want the "global" value, no need to use the
            // legacy kernel, the legacy resolver is enough
            return $this->legacyResolver->getGroup($groupName);
        }

        return $this->legacyKernel->runCallback(
            static function () use ($file, $groupName, $siteaccess) {
                // @todo: do reset injected settings everytime
                // and make sure to restore the previous injected settings
                eZINI::injectSettings([]);

                return eZSiteAccess::getIni($siteaccess, $file)->group($groupName);
            },
            false,
            false
        );
    }
894597
public static function getByName($blockName)
    {
        if (!$blockName) {
            return;
        }
        $app = Application::getFacadeApplication();
        $now = $app->make('date')->getOverridableNow();
        $db = Loader::db();
        $sql = <<<'EOT'
SELECT
    b.bID,
    cvb.arHandle,
    cvb.cID
FROM
    Blocks AS b
    INNER JOIN CollectionVersionBlocks AS cvb
        ON b.bID = cvb.bID
    INNER JOIN CollectionVersions AS cv
        ON cvb.cID = cv.cID AND cvb.cvID = cv.cvID
WHERE
    b.bName = ?
    AND cv.cvIsApproved = 1 AND (cv.cvPublishDate IS NULL or cv.cvPublishDate <= ?) AND (cv.cvPublishEndDate IS NULL or cv.cvPublishEndDate >= ?)
ORDER BY
    cvb.cvID DESC
LIMIT 1
EOT
        ;
        $vals = [$blockName, $now, $now];
        $row = $db->getRow($sql, $vals);
        if ($row != false && isset($row['bID']) && $row['bID'] > 0) {
            return self::getByID($row['bID'], Page::getByID($row['cID']), $row['arHandle']);
        } else {
            return new self();
        }
    }
382703
public function getGroup($groupName)
    {
        return isset($this->groups[$groupName]) ? $this->groups[$groupName] : null;
    }
370647
final public function get($varname)
    {
        $previous = isset($this->data[$varname]) ? $this->data[$varname] : null;

        return $previous;
    }
835187
public function getVariable($key)
    {
        if (isset($this->variables[$key])) {
            return $this->variables[$key];
        }
        return false;
    }
539671
protected function _getVars(string $tableName) : array
    {
        $table = Inflector::tableize($tableName);

        $name = Inflector::camelize($tableName) . $this->_getLastModifiedTime($table);

        return [$table, $name];
    }
213147
public static function get($jname = '', $default = false) {
		if (!isset($groups)) {
			$db = Factory::getDbo();
			$query = $db->getQuery(true)
				->select('value')
				->from('#__jfusion_settings')
				->where($db->quoteName('key') . ' = ' . $db->quote('user.groups'));

			$db->setQuery($query);

			$groups = $db->loadResult();

			if ($groups) {
				$groups = new Registry($groups);

				$groups = $groups->toObject();
			} else {
				$groups = false;
			}
		}

		if ($jname) {
			if (isset($groups->{$jname})) {
				$usergroups = $groups->{$jname};
				if ($default) {
					if (isset($usergroups[0])) {
						$usergroups = $usergroups[0];
					} else {
						$usergroups = null;
					}
				}
			} else {
				if ($default) {
					$usergroups = null;
				} else {
					$usergroups = array();
				}
			}
		} else {
			$usergroups = $groups;
		}

		return $usergroups;
	}
951676
public function renderBlock(string $blockName): string
    {
        if (!$this->template->hasBlock($blockName, $this->context, $this->blocks)) {
            return '';
        }

        $level = ob_get_level();
        ob_start();

        try {
            $this->template->displayBlock($blockName, $this->context, $this->blocks);
        } catch (Throwable $t) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }

            throw $t;
        }

        return (string) ob_get_clean();
    }
391274
public function getSampleBlock($blockNum)
    {
        // check preconditions
        if (!$this->_dataSize_valid) {
            $this->setDataSize();  // implicit setSize(), setActualSize(), setNumBlocks()
        }

        $offset = $blockNum * $this->_blockAlign;
        if ($offset + $this->_blockAlign > $this->_dataSize || $offset < 0) {
            return null;
        }


        // read data
        return substr($this->_samples, $offset, $this->_blockAlign);
    }
566680
private function getTokens($methodName)
    {
        preg_match_all('([A-Z_-][^A-Z_-]*)', $methodName, $rawTokens);
        $result = array();
        $lastToken = null;
        $seenBy = false;
        foreach ($rawTokens[0] as $token) {
            $newToken = $this->getToken($token, $seenBy);

            if ($newToken instanceof ValueToken) {
                $lastToken = $lastToken !== null && $lastToken instanceof ValueToken ?
                    new ValueToken($lastToken->getSource() . $newToken->getSource()) :
                    $newToken;
            } else {
                if ($lastToken instanceof ValueToken) {
                    // Add the last token too
                    $result[] = $lastToken;
                    $lastToken = null;
                }
                $result[] = $newToken;
            }
        }

        if ($lastToken !== null) {
            $result[] = $lastToken;
        }


        return $result;
    }