protected function addError($name, $customMessage = null)
    {
        $this->errors[$name] = $customMessage ?: $this->message ?: $this->{$name . 'Message'};
    }
protected function addError($name, $customMessage = null)
    {
        $this->errors[$name] = $customMessage ?: $this->message ?: $this->{$name . 'Message'};
    }
protected function addError ( $ name , $ customMessage = null ) { $ this -> errors [ $ name ] = $ customMessage ? : $ this -> message ? : $ this -> { $ name . 'Message' } ; }
Adds error definition

@param string $name The name of error
@param string $customMessage The custom error message
Adds error definition