Check if an element needs hydrated.

@param $countryCode
@param $element
@param bool $enabled
@return bool
170237
protected function needsHydration($countryCode, $element, $enabled = false)
    {
        if (! $this->canHydrate($element, $enabled, $countryCode)) {
            return false;
        }

        return $this->updateHydrated($countryCode, $element);
    }
666027
private function setModuleStatus($element, $enabled=1)
	{
		if ($this->baseDb->tableExists('#__extensions'))
		{
			$query = "UPDATE `#__extensions` SET `enabled` = '{$enabled}' WHERE `element` = '{$element}'";
			$this->baseDb->setQuery($query);
			$this->baseDb->query();
		}

		if ($this->baseDb->tableExists('#__modules'))
		{
			$query = "UPDATE `#__modules` SET `published` = '{$enabled}' WHERE `module` = '{$element}'";
			$this->baseDb->setQuery($query);
			$this->baseDb->query();
		}

		$this->log(sprintf('Set module "%s" status to "%s"', $element, $enabled));
	}
129575
public function getParkingRate($countryCode)
    {
        $country = $this->getCountry($countryCode);
        if (!is_null($country)) {
            return $country->getParkingRate();
        }

        return null;
    }
1157098
public function canValidate(
        SignedElement $signedElement,
        CertificateProvider $configuration
    ) : bool {
        $this->configuredKeys = $this->keyLoader->extractPublicKeys($configuration);

        return !!count($this->configuredKeys);
    }
1007090
public function getCountryFlag(string $countryCode): string
    {
        try {
            return FlagGenerator::fromCountryCode($countryCode);
        } catch (Throwable $t) {
            return $countryCode;
        }
    }
1105190
public static function countryLocaleCode($countryCode)
    {
        $countryLocaleCodes = static::countryLocaleCodes($countryCode);
        if ($languageCode = Language::countryLanguageCode($countryCode)) {
            $languageLocaleCodes = static::languageLocaleCodes($languageCode);
            if ($localeCodes = array_intersect($languageLocaleCodes, $countryLocaleCodes)) {
                return reset($localeCodes);
            } elseif ($countryLocaleCodes) {
                return reset($countryLocaleCodes);
            } elseif ($languageLocaleCodes) {
                return reset($languageLocaleCodes);
            }

            return \Locale::composeLocale([
                'language' => $languageCode,
                'region' => $countryCode,
            ]);
        }

        if (!count($countryLocaleCodes)) {
            return null;
        } elseif (count($countryLocaleCodes) == 1) {
            return reset($countryLocaleCodes);
        }

        if ($localeCode = static::findMainCode($countryLocaleCodes)) {
            return $localeCode;
        }

        foreach ($countryLocaleCodes as $localeCode) {
            $languageCode = static::languageCode($localeCode);
            if (!strcasecmp($languageCode, $countryCode)) {
                return $localeCode;
            }
        }

        return reset($countryLocaleCodes);
    }
199586
public static function languageCountryLocaleCode($languageCode, $countryCode)
    {
        $countryLocaleCodes = static::countryLocaleCodes($countryCode);
        $languageLocaleCodes = static::languageLocaleCodes($languageCode);
        if ($localeCodes = array_intersect($languageLocaleCodes, $countryLocaleCodes)) {
            return reset($localeCodes);
        }

        return \Locale::composeLocale([
            'language' => $languageCode,
            'region' => $countryCode,
        ]);
    }
1102383
private function setPluginStatus($folder, $element, $enabled=1)
	{
		if ($this->baseDb->tableExists('#__plugins'))
		{
			$query = "UPDATE `#__plugins` SET `published` = '{$enabled}' WHERE `folder` = '{$folder}' AND `element` = '{$element}'";
			$this->baseDb->setQuery($query);
			$this->baseDb->query();
		}
		elseif ($this->baseDb->tableExists('#__extensions'))
		{
			$query = "UPDATE `#__extensions` SET `enabled` = '{$enabled}' WHERE `folder` = '{$folder}' AND `element` = '{$element}'";
			$this->baseDb->setQuery($query);
			$this->baseDb->query();
		}

		$this->log(sprintf('Set plugin "plg_%s_%s" status to "%s"', $folder, $element, $enabled));
	}
20712
protected void checkRequired(String key, AnnotatedElement element) {
        if (isRequired(element)) {
            throw new PropertyLoaderException(String.format("Required property <%s> doesn't exists", key));
        }
    }
625754
function disable_($countryId, $customerId) {return dfc($this, function($countryId, $customerId) {return
		$this->b('enabled') && (
			$this->b('forAll')
			|| ($this->b('forReturning') && !df_customer_is_new($customerId))
			|| $this->countries($countryId)
		)
	;}, func_get_args());}
970929
public function where($key, $operator, $value = null)
    {
        if (func_num_args() == 2) {
            $value = $operator;

            $operator = '=';
        }

        $countries = method_exists($this, 'where'.ucfirst($key))
            ? $this->{'where'.ucfirst($key)}($value)
            : parent::where($key, $operator, $value);

        return $this->hydrateDefaultElements($countries);
    }
243534
protected function _isInheritCheckboxRequired(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        return $element->getCanUseContainerValue() || $element->getCanUseDefaultValue();
    }
333144
public function contains($element, bool $strict = true): bool
    {
        return \in_array($element, $this->data, $strict);
    }
366680
protected function processDefinition($countryCode, array $definition)
    {
        $definition['country_code'] = $countryCode;
        // Merge-in defaults.
        $definition += $this->getGenericDefinition();
        // Always require the given name and family name.
        $definition['required_fields'][] = AddressField::GIVEN_NAME;
        $definition['required_fields'][] = AddressField::FAMILY_NAME;

        return $definition;
    }
183124
public function _includeElements(&$element)
    {
        if ($element->isGlobal() && !$element->isFinal() && !$this->_globals) {
            return FALSE;
        } elseif ($element->isGlobal() && $element->isFinal() && !$this->_constants) {
            return FALSE;
        } elseif (!$this->_private && $element->isPrivate()) {
            return FALSE;
        } elseif ($this->_private) {
            return TRUE;
        } elseif ($this->_protected && ($element->isPublic() || $element->isProtected())) {
            return TRUE;
        } elseif ($this->_public && $element->isPublic()) {
            return TRUE;
        }

        return FALSE;
    }
697745
protected function _isDisabled($key, $disabled)
    {
        if ($disabled === null || $disabled === false) {
            return false;
        }
        if ($disabled === true || is_string($disabled)) {
            return true;
        }
        $strict = !is_numeric($key);

        return in_array((string)$key, $disabled, $strict);
    }
681693
public function checkRequired($validator, Element &$element)
    {
        if (in_array($validator, ['notEmpty'])) {
            $element->getInput()->required = true;
            $element->getInput()->allowEmpty = false;
        }
    }