Custom attribute writer method checking allowed values (enum).
 @param [Object] hispanic_ethnicity Object to be assigned
426045
def hispanic_ethnicity=(hispanic_ethnicity)
      validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
      unless validator.valid?(hispanic_ethnicity)
        fail ArgumentError, "invalid value for 'hispanic_ethnicity', must be one of #{validator.allowable_values}."
      end
      @hispanic_ethnicity = hispanic_ethnicity
    end
272076
def _write_enums(self, entity_name, attributes):
        
        
        self.enum_attrs_for_locale[entity_name] = attributes;

        for attribute in attributes:
            enum_name = "%s%sEnum" % (entity_name, attribute.name[0].upper() + attribute.name[1:])
            self.enum_list.append(enum_name)
            filename = "%s%s.js" % (self._class_prefix, enum_name)
            self.write(destination = self.enum_directory,
                        filename=filename,
                        template_name="enum.js.tpl",
                        class_prefix = self._class_prefix,
                        enum_name = enum_name,
                        allowed_choices = set(attribute.allowed_choices))
424142
function addEnumeration( $element )
    {
        $enumvalue = eZEnumValue::create( $this->ClassAttributeID, $this->ClassAttributeVersion, $element );
        $enumvalue->store();
        $this->Enumerations = eZEnumValue::fetchAllElements( $this->ClassAttributeID, $this->ClassAttributeVersion );
    }
56700
function ENUM(values) {
    if (!values || !(values instanceof Array) || !values.length) {
        throw new Error();
    }
    if (!(this instanceof ENUM)) {
        return new ENUM(values);
    }
    this.sql = 'ENUM(' + values.join(',') + ')';
}
669529
def sort_order=(sort_order)
      validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
      unless validator.valid?(sort_order)
        fail ArgumentError, "invalid value for 'sort_order', must be one of #{validator.allowable_values}."
      end
      @sort_order = sort_order
    end
326928
private function _checkVariableConfiguration() {
		// Check if the canUploadImage is boolean
		if (!is_bool($this->canUploadImage)) {
			throw new InvalidConfigException('$canUploadImage variable only supports a boolean value, if you have a custom function you must return a boolean.');
		}
		// Check if the canRemoveImage is boolean
		if (!is_bool($this->canRemoveImage)) {
			throw new InvalidConfigException('$removeImageAllowed variable only supports a boolean value, if you have a custom function you must return a boolean.');
		}
		// Check if the setBlamableBehavior is boolean
        if (! is_bool($this->setBlameableBehavior))
            throw new InvalidConfigException('$setBlameableBehavior only supports a boolean value, if you have a custom function make sure that you return a boolean.');
        // Check if the deleteOriginalAfterEdit is boolean
        if (! is_bool($this->deleteOriginalAfterEdit))
            throw new InvalidConfigException('$deleteOriginalAfterEdit only supports boolean value, if you have a custom function make sure that your return a boolean.');

		// Check if the blameable behavior is set to true
        if ($this->setBlameableBehavior) {
            // Get the migration record
            $mRecordMigrationRun = Yii::$app->db->createCommand('SELECT * FROM {{%migration}} WHERE `version` = \'m170223_113221_addBlameableBehavior\'')->queryOne();
            if ($mRecordMigrationRun === false) {
                throw new InvalidConfigException('Image Manager: You have not run the latest migration, see the documentation how to do this.');
            }
        }
	}
819595
def ell_status=(ell_status)
      validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
      unless validator.valid?(ell_status)
        fail ArgumentError, "invalid value for 'ell_status', must be one of #{validator.allowable_values}."
      end
      @ell_status = ell_status
    end
573126
def validate_enum_attribute(self, attribute: str,
                                candidates: Set[Union[str, int, float]]) -> None:
        
        self.add_errors(
            validate_enum_attribute(self.fully_qualified_name, self._spec, attribute, candidates))
1076464
def border_dash_style=(border_dash_style)
      validator = EnumAttributeValidator.new('String', ["Dash", "DashDot", "DashDotDot", "DashLongDash", "DashLongDashDot", "RoundDot", "Solid", "SquareDot"])
      if border_dash_style.to_i == 0
        unless validator.valid?(border_dash_style)
          raise ArgumentError, "invalid value for 'border_dash_style', must be one of #{validator.allowable_values}."
        end
        @border_dash_style = border_dash_style
      else
        @border_dash_style = validator.allowable_values[border_dash_style.to_i]
      end
    end
335068
protected function _validateEnumValue($arg)
	{
		parent::_validateEnumValue($arg);
		$enum = strtoupper(trim($arg));
		if($enum !== 'ASC' && $enum !== 'DESC')
		{
			throw new \InvalidArgumentException('argument has to be a string of asc or desc!');
		}
		$this->enum = $enum;
	}
204760
def gender=(gender)
      validator = EnumAttributeValidator.new('String', ["M", "F", ""])
      unless validator.valid?(gender)
        fail ArgumentError, "invalid value for 'gender', must be one of #{validator.allowable_values}."
      end
      @gender = gender
    end
11713
def sort=(sort)
      validator = EnumAttributeValidator.new('String', ["COUNT", "INDEX"])
      unless validator.valid?(sort)
        fail ArgumentError, "invalid value for 'sort', must be one of #{validator.allowable_values}."
      end
      @sort = sort
    end
796859
def selection_type=(selection_type)
      validator = EnumAttributeValidator.new('String', ["SINGLE", "MULTIPLE"])
      unless validator.valid?(selection_type)
        fail ArgumentError, "invalid value for 'selection_type', must be one of #{validator.allowable_values}."
      end
      @selection_type = selection_type
    end
104923
protected function castToEnum($key, $value): ?Enum
    {
        $enum = $this->enumCasts[$key];

        if ($value === null || $value instanceOf Enum) {
            return $value;
        } else {
            return $enum::getInstance($value);
        }
    }
853573
def document_type=(document_type)
      validator = EnumAttributeValidator.new('String', ["pdf", "xls", "xlsx"])
      unless validator.valid?(document_type)
        fail ArgumentError, "invalid value for 'document_type', must be one of #{validator.allowable_values}."
      end
      @document_type = document_type
    end
908713
def background_color_crop_type=(background_color_crop_type)
      validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
      if background_color_crop_type.to_i == 0
        unless validator.valid?(background_color_crop_type)
          raise ArgumentError, "invalid value for 'background_color_crop_type', must be one of #{validator.allowable_values}."
        end
        @background_color_crop_type = background_color_crop_type
      else
        @background_color_crop_type = validator.allowable_values[background_color_crop_type.to_i]
      end
    end
1126886
def eac3_lt_rt_center_mix_level=(eac3_lt_rt_center_mix_level)
      validator = EnumAttributeValidator.new('String', ["c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7"])
      unless validator.valid?(eac3_lt_rt_center_mix_level)
        fail ArgumentError, "invalid value for 'eac3_lt_rt_center_mix_level', must be one of #{validator.allowable_values}."
      end
      @eac3_lt_rt_center_mix_level = eac3_lt_rt_center_mix_level
    end