/** * Checks if string field value is a valid country code. * * @param string $fieldName The name of the property to be checked * @return boolean result of this check */ public function isValidCountry($fieldName) { $countryMap = ZLanguage::countrymap(); return in_array($this->entity[$fieldName], array_keys($countryMap)); }