public function setValue($value)
    {
        if (!$this->isValid($value)) {
            throw new \UnexpectedValueException("Value '$value' is not part of the enum ".get_called_class());
        }
        $this->value = $value;
    }
public function setValue($value)
    {
        if (!$this->isValid($value)) {
            throw new \UnexpectedValueException("Value '$value' is not part of the enum ".get_called_class());
        }
        $this->value = $value;
    }
public function setValue ( $ value ) { if ( ! $ this -> isValid ( $ value ) ) { throw new \ UnexpectedValueException ( "Value '$value' is not part of the enum " . get_called_class ( ) ) ; } $ this -> value = $ value ; }
Tries to set the value  of this enum.

@param string $value

@throws Exception If value is not part of this enum
Tries to set the value of this enum .