public function setGender($genderKey)
    {
        $validGenderKeys = [self::GENDER_MALE, self::GENDER_FEMALE, self::GENDER_UNKNOWN];
        if (!in_array($genderKey, $validGenderKeys, true)) {
            throw new \InvalidArgumentException(
                '$genderKey must be one of the predefined constants, but actually is: ' . $genderKey,
                1393329321
            );
        }

        $this->setAsInteger('gender', $genderKey);
    }
public function setGender($genderKey)
    {
        $validGenderKeys = [self::GENDER_MALE, self::GENDER_FEMALE, self::GENDER_UNKNOWN];
        if (!in_array($genderKey, $validGenderKeys, true)) {
            throw new \InvalidArgumentException(
                '$genderKey must be one of the predefined constants, but actually is: ' . $genderKey,
                1393329321
            );
        }

        $this->setAsInteger('gender', $genderKey);
    }
public function setGender ( $ genderKey ) { $ validGenderKeys = [ self :: GENDER_MALE , self :: GENDER_FEMALE , self :: GENDER_UNKNOWN ] ; if ( ! in_array ( $ genderKey , $ validGenderKeys , true ) ) { throw new \ InvalidArgumentException ( '$genderKey must be one of the predefined constants, but actually is: ' . $ genderKey , 1393329321 ) ; } $ this -> setAsInteger ( 'gender' , $ genderKey ) ; }
Sets the gender.

@param int $genderKey one of the predefined gender constants

@return void

@throws \InvalidArgumentException
Sets the gender .