public function setGender($gender)
    {
        if (!in_array($gender, self::$genders, true)) {
            return $this;
        }

        $this->gender = $gender;

        return $this;
    }
public function setGender($gender)
    {
        if (!in_array($gender, self::$genders, true)) {
            return $this;
        }

        $this->gender = $gender;

        return $this;
    }
public function setGender ( $ gender ) { if ( ! in_array ( $ gender , self :: $ genders , true ) ) { return $ this ; } $ this -> gender = $ gender ; return $ this ; }
Set gender, if the gender is allowed.

@param int $gender Gender

@return $this Self object
Set gender if the gender is allowed .