Get region

If no "region" value has been set, this method will
set and return a default "region" value,
if any such value is available

@see getDefaultRegion()

@return string|null region or null if no region has been set
500703
public function getRegion() : ?string 
    {
        if ( ! $this->hasRegion()) {
            $this->setRegion($this->getDefaultRegion());
        }
        return $this->region;
    }
1108570
private Region findRegion() {
    boolean regionProvided = !Validator.isBlank(this.region);
    if(!regionProvided) {
      // Determine region from where application is running, or fall back to default region
      Region currentRegion = Regions.getCurrentRegion();
      if(currentRegion != null) {
        return currentRegion;
      }
      return Region.getRegion(Regions.fromName(AppenderConstants.DEFAULT_REGION));
    }
    return Region.getRegion(Regions.fromName(this.region));
  }
629300
public static function get_default() {
        if ($visiblechildren = self::top()->get_children()) {
            $defcategory = reset($visiblechildren);
        } else {
            $toplevelcategories = self::get_tree(0);
            $defcategoryid = $toplevelcategories[0];
            $defcategory = self::get($defcategoryid, MUST_EXIST, true);
        }
        return $defcategory;
    }
244924
public function getFormat() : ?string 
    {
        if ( ! $this->hasFormat()) {
            $this->setFormat($this->getDefaultFormat());
        }
        return $this->format;
    }
67277
public static function getDefaultCountry()
    {
        if (null === self::$defaultCountry) {
            self::$defaultCountry = CountryQuery::create()->findOneByByDefault(true);

            if (null === self::$defaultCountry) {
                throw new \LogicException(Translator::getInstance()->trans("Cannot find a default country. Please define one."));
            }
        }

        return self::$defaultCountry;
    }
1193909
public static function getDefaultValue($param = null)
    {
        $result = null;

        if (empty($param)) {
            return static::$defaults;
        }

        if (isset(static::$defaults[$param])) {
            $result = static::$defaults[$param];
        }

        return $result;
    }
511399
public function getType() : ?string 
    {
        if ( ! $this->hasType()) {
            $this->setType($this->getDefaultType());
        }
        return $this->type;
    }
854030
protected function _getRegion()
    {
        if (isset($this->_matchingData['BlockRegions'])) {
            return $this->_matchingData['BlockRegions'];
        }

        if (isset($this->_properties['region'])) {
            return $this->_properties['region'];
        }
    }
466731
public function getAreaId()
    {
        $firstAreaCountry = CountryAreaQuery::create()->findOneByCountryId($this->getId());

        if (null !== $firstAreaCountry) {
            return $firstAreaCountry->getAreaId();
        }

        return null;
    }
707922
public function getDefaultCode()
    {
        $oDefault = $this->getDefault();
        return empty($oDefault->code) ? false : $oDefault->code;
    }
1170660
public function getPhpSafeDefaultValue()
    {
        $value     = $this->getDefaultValue();
        $is_string = $this->hasType() && $this->getType()->getName() === 'string';

        if ($value === true) {
            return 'true';
        } elseif ($value === false) {
            return 'false';
        } elseif ($this->isDefaultValueConstant()) {
            if (strpos($this->getDefaultValueConstantName(), 'self') === 0) {
                return $this->getDefaultValueConstantName();
            }
            return '\\' . $this->getDefaultValueConstantName();
        } elseif (is_array($value)) {
            return '[]';
        } elseif (null === $value || ($is_string && $value === 'null' && $this->allowsNull())) {
            return 'null';
        } elseif (is_numeric($value) && !$is_string) {
            return (string) $value;
        }
        return var_export($value, true);
    }
1374358
protected function getRegion()
    {
        if (empty($this->sS3Region)) {
            $this->sS3Region = $this->getRegionAndBucket()->region;
            if (empty($this->sS3Region)) {
                throw new DriverException('S3 Region has not been defined.');
            }
        }

        return $this->sS3Region;
    }
624377
public function getCountryIdAttribute()
    {
        if (isset($this->attributes['country_id']) && $this->attributes['country_id'] > 0) {
            return $this->attributes['country_id'];
        }

        $configRepository = app(ConfigurationInterface::class);
        $defaultCountry = $configRepository->getValueByKey('user_default_country');

        if (isset($defaultCountry)) {
            return $defaultCountry;
        }

        return null;
    }
311939
public static function getLocale()
    {
        static::getDefaultLocale();
        $current = Locale::getDefault();
        if ($current === '') {
            $current = static::DEFAULT_LOCALE;
            Locale::setDefault($current);
        }

        return $current;
    }
695589
public function getDefault() {
    	if ($this->isPublic() && !$this->isStatic() && $this->refClass->isAbstract() == false) {	    		 
	  		$className = $this->refClass->getName();
	  		// TODO: find a way to get default value for abstract properties.
	  		// TODO: optimize this: we should not have to create one new instance for every property....
	  		/*$instance = new $className();
			$property = $this->getName();
	    	return $instance->$property;*/
	  		
	  		// In some cases, the call to getDefaultProperties can log NOTICES
	  		// in particular if an undefined constant is used as default value.
	  		ob_start();
	  		$defaultProperties = $this->refClass->getDefaultProperties();
	  		$possibleError = ob_get_clean();
			if ($possibleError) {
				throw new \Exception($possibleError);	
			}
	  		return $defaultProperties[$this->getName()];
    	} else {
    		return null;
    	}
    }
256519
public function getDefaultValue()
    {
        if (1 != $this->parameters->get('defaultValueIsNull')) {
            $defaultValue = $this->parameters->get('defaultValue');
            if (strlen($defaultValue) && 'NULL' != $defaultValue) {
                return trim($defaultValue, '\'"');
            }
        }
    }
285077
public function getDefaultLocale()
    {
        $locales = $this->getLocales();

        foreach ($locales as $locale) {
            if ($locale->isDefault()) {
                return $locale;
            }
        }

        return array_pop($locales);
    }