Returns an array of block content objects that exist in a region

@param string $region a block region that exists on this page.
@return array of block block_contents objects for all the blocks in a region.
435748
public function get_content_for_region($region, $output) {
        $this->check_is_loaded();
        $this->ensure_content_created($region, $output);
        return $this->visibleblockcontent[$region];
    }
807782
private function getConfigWithCredentials($region, $credential)
    {
        if (!in_array($region, self::$awsRegions, true)) {
            $this->logger->critical(self::ERR_INVALID_REGION, [
                'specified_region' => $region,
            ]);

            return null;
        }

        $credentials = null;

        if ($credential instanceof AWSStaticCredential) {
            $credentials = $this->credentialProvider->getStaticCredentials($credential);

        } elseif ($credential instanceof AWSRoleCredential) {
            $credentials = $this->credentialProvider->getRoleCredentials($credential, $region);
        }

        if (!$credentials) {
            $this->logger->critical(self::ERR_INVALID_CREDENTIAL);
            return null;
        }

        return [
            'region' => $region,
            'credentials' => $credentials,
        ];
    }
842134
public function getShardByRegion($region)
	{
		foreach($this->info as $shard) {
			if($shard->slug == $region)
				return $shard;
		}
		return null;
	}
138167
public function setRegion($region)
    {
        $this->region = strtolower($region);

        $this->updateApiUrl($region);
        $this->updateApiAccessTokenUrl($region);

        return $this;
    }
1159459
public function isPageContextRegion($region, $theme)
    {
        $regions = $this->getThemeRegionConfig($theme);
        return (isset($regions[$region]) && ($regions[$region] === self::CONTEXT_PAGE));
    }
243834
public function blocks($region, $classes = array(), $tag = 'aside') {
        $displayregion = $this->page->apply_theme_region_manipulations($region);
        $classes = (array)$classes;
        $classes[] = 'block-region';
        $attributes = array(
            'id' => 'block-region-'.preg_replace('#[^a-zA-Z0-9_\-]+#', '-', $displayregion),
            'class' => join(' ', $classes),
            'data-blockregion' => $displayregion,
            'data-droptarget' => '1'
        );
        if ($this->page->blocks->region_has_content($displayregion, $this)) {
            $content = $this->blocks_for_region($displayregion);
        } else {
            $content = '';
        }
        return html_writer::tag($tag, $content, $attributes);
    }
1072909
public function getValidBlockItemsAsContentInfo(Block $block)
    {
        $contentInfoObjects = array();
        foreach ($this->getValidBlockItems($block) as $item) {
            try {
                $contentInfoObjects[] = $this->contentService->loadContentInfo($item->contentId);
            } catch (UnauthorizedException $e) {
                // If unauthorized, disregard block as "valid" and continue loading other blocks.
            }
        }

        return $contentInfoObjects;
    }
436304
@Override
  public Regions getAvailableRegions(Integer pageNo)
      throws DigitalOceanException, RequestUnsuccessfulException {
    validatePageNo(pageNo);
    return (Regions) perform(new ApiRequest(ApiAction.AVAILABLE_REGIONS, pageNo, DEFAULT_PAGE_SIZE))
        .getData();
  }
1094393
private function getRegionUrls()
    {
        $regionObject = new Regions();
        $this->mwsServiceUrls = $regionObject->mwsServiceUrls;
        $this->regionMappings = $regionObject->regionMappings;
        $this->profileEndpointUrls = $regionObject->profileEndpointUrls;
    }
753306
public function getAreaBlocksArray($c = false)
    {
        if (!$c) {
            $c = $this->c;
        }
        if (!$this->arIsLoaded) {
            $this->load($c);
        }

        return $this->areaBlocksArray;
    }
125215
public function getMissingBlocks(Array $blocks = array())
    {
        $missing = array();
        $blocks  = $blocks ? $blocks : $this->getWroteBlocks();
        $last    = array_shift($blocks);

        if ($last['offset'] !== 0) {
            $missing[] = array('offset' => 0, 'size' => $last['offset']);
        }

        foreach ($blocks as $block) {
            if ($block['offset'] !== $last['offset'] + $last['size']) {
                $offset = $last['offset'] + $last['size'];
                $missing[] = array('offset' => $offset, 'size' => $block['offset'] - $offset);
            }
            $last = $block;
        }

        return $missing;
    }
631604
public RegionPageSectionBuilder region(final PageSectionContent.Region region) {
		switch (region) {
		case LEFT: // Use left region
			this.curRegionBox = this.leftRegionBox;
			break;
		case CENTER: // Use center region
			this.curRegionBox = this.centerRegionBox;
			break;
		case RIGHT: // Use right region
			this.curRegionBox = this.rightRegionBox;
			break;
		default: // Invalid footerRegionValue, use center region as default
			throw new IllegalStateException();
		}
		return this;
	}
9667
public function get_regions() {
        if (is_null($this->defaultregion)) {
            $this->page->initialise_theme_and_output();
        }
        return array_keys($this->regions);
    }
705981
private function getStsWithInternalCredentials($region)
    {
        if ($this->useHostCredentials) {
            return $this->aws->createSts([
                'region' => $region,
                'credentials' => $this->hostCredentials,
            ]);
        }

        $credentials = $this->em
            ->getRepository(Credential::class)
            ->findOneBy(['isInternal' => true, 'name' => $this->credentialName]);

        if (!$credentials instanceof Credential) {
            $this->logger->critical(sprintf(self::ERR_INVALID_INTERNAL_CREDENTIALS, $this->credentialName));
            return null;
        }

        if (!$credentials->details() instanceof AWSStaticCredential) {
            $this->logger->critical(sprintf(self::ERR_INVALID_INTERNAL_CREDENTIALS, $this->credentialName));
            return null;
        }

        if (!$internalCredentials = $this->getStaticCredentials($credentials->details())) {
            return null;
        }

        return $this->aws->createSts([
            'region' => $region,
            'credentials' => $internalCredentials,
        ]);
    }
566172
public function loadZoneBlocksData(Zone $zone): array
    {
        $query = $this->getBlockSelectQuery();
        $query->where(
            $query->expr()->like('b.path', ':path')
        )
        ->setParameter('path', '%/' . $zone->rootBlockId . '/%', Type::STRING);

        $this->applyStatusCondition($query, $zone->status, 'b.status');

        return $query->execute()->fetchAll(PDO::FETCH_ASSOC);
    }
525970
public function getBlocksFromAppliedBlockSets($area = null, $includeDisabled = false)
	{
		$blocks = ArrayList::create();
		$sets = $this->getAppliedSets();

		if (!$sets->count()) {
			return $blocks;
		}

		foreach ($sets as $set) {
			$setBlocks = $set->Blocks()->sort('Sort DESC');

			if (!$includeDisabled) {
				$setBlocks = $setBlocks->exclude('ID', $this->owner->DisabledBlocks()->column('ID'));
			}

			if ($area) {
				$setBlocks = $setBlocks->filter('BlockArea', $area);
			}

			$blocks->merge($setBlocks);
		}

		$blocks->removeDuplicates();

		return $blocks;
	}
1266339
public function getContentRules()
    {
        if (!$this->contentAttribute) {
            return [];
        }
        $rules = [];
        $rules[] = [$this->contentAttribute, 'required'];
        if ($this->contentAttributeRule) {
            if (is_string($this->contentAttributeRule)) {
                $this->contentAttributeRule = [$this->contentAttributeRule];
            }
            if (is_array($this->contentAttributeRule)) {
                $rules[] = array_merge([$this->contentAttribute], $this->contentAttributeRule);
            }
        }

        if (!$this->contentTypeAttribute) {
            return $rules;
        }

        if (is_array($this->contentTypes) && !empty($this->contentTypes)) {
            $rules[] = [[
                $this->contentTypeAttribute],
                'required'];
            $rules[] = [[
                $this->contentTypeAttribute],
                'in',
                'range' => array_keys($this->contentTypes)];
        }
        return $rules;
    }