Sets the value of the Error.

@param mixed Error or an array of Error Error
@return this instance
187906
public function setError($error) 
    {
        if (!$this->_isNumericArray($error)) {
            $error =  array ($error);    
        }
        $this->_fields['Error']['FieldValue'] = $error;
        return $this;
    }
634672
protected function setError($key, $error)
    {
        gplcart_array_set($this->errors, $this->getKeyPath($key), $error);
        return $this->errors;
    }
757609
public function mail($error) {
        if ($this->_exist) {
            array_push($this->_constraints, ['type' => self::MAIL, 'message' => $error]);
        }

        return $this;
    }
1262229
protected function add_error($name = null, $error = null)
	{
		if($name !== null and $error !== null)
		{
			$this->errors[$name] = $error;
		}

		return $this;
	}
1198019
protected final function setError($key, $error = null){
        if($e = $this->getDefinitionValue($key,'error')){
            $error = $e;
        } else if($error === null){
            $error = sprintf($this->defaultErrorMessage,$key);
        }//elif
        $this->errors[$key] = $error;
        return false;
    }
1001101
public function alphaNum($error) {
        if ($this->_exist) {
            array_push($this->_constraints, ['type' => self::ALPHANUM, 'message' => $error]);
        }

        return $this;
    }
329312
public function set($property, $value = null)
    {
        if (is_array($property)) {
            foreach ($property as $k => $v) {
                $this->set($k, $v);
            }

            return $this;
        }

        if ($this->has($property)) {
            $method = 'set' . Str::studly($property);
            $value  = $this->sanitizeSetterValue($method, $value);

            $this->message->{$method}($value);
        }

        return $this;
    }
871922
public function setError($key, $value)
    {
        if (isset($key)) {
            gplcart_array_set($this->errors, $key, $value);
        } else {
            $this->errors = (array) $value;
        }

        return $this->errors;
    }
985183
public function setError($error, $propertyName)
    {
        $this->errors[$this->propertyName][$propertyName] = $error;

        return $this;
    }
838295
protected function decideOnFailure($error)
    {
        if (! isset($this->errors[$error])) {
            throw new UnexpectedValueException(sprintf(
                'Unexpected error "%s" received. All error must be specified '
                . 'in errors array of this instance.',
                $error
            ));
        }
        $this->state = static::STATE_FAILURE | static::STATE_BREAK;

        $this->operationError            = $error;
        $this->operationErrorDescription = $this->errors[$error];
    }
1198996
public function setError($error, $code = \wf\model\Error::DEFAULT_MODEL_ERROR_CODE)
    {
        if ($error instanceof \wf\model\Error) {
            $this->error = $error;
        } elseif (is_scalar($error)) {
            $this->error = new \wf\model\Error($error, $code);
        } else {
            throw new \InvalidArgumentException('错误的消息类型');
        }

        return $this;
    }
805800
public function set($value)
        {
            $this->validate($value);
            $this->original = $value;
            $this->current = $value;
            $this->chaining = false;
            $this->chain = null;
            return $this;
        }
871467
public function setValue($value)
	{
		$failure = true;
		switch($this->opration)
		{
			case '==':
				if($value==$this->condition)
					$failure = false;
				break;
			case '>':
				if($value>$this->condition)
					$failure = false;
				break;
			case '>=':
				if($value>=$this->condition)
					$faulure = false;
				break;
			case '<':
				if($value<$this->condition)
					$failure = false;
				break;
			case '<=':
				if($value<=$this->condition)
					$failure = false;
				break;
			case '*':
				if(strpos($value, $this->condition)!==false)
					$failure = false;
				break;
			case '^':
				if(strpos($value, $this->condition)===0)
					$failure = false;
				break;
			case '$':
				if(strrpos($value, $this->condition)==strlen($value)-strlen($this->condition))
					$failure = false;
				break;
			default:
				break;
		}
		if($failure)
			throw $this->getContext()->getModel('ValidationException', 'Form', array(
				array(
					'' => 'condition failed'
				)
			));
		return $value;
	}
913299
public function setError(array $msg)
    {
        if (!isset($msg['msg']))
            throw new InvalidArgumentException("Error message does not contain msg key");

        $this->errors = [$msg];
        $this->fixed_error = $msg;
        return $this;
    }
899160
public function setValue($value)
    {
        if (!is_array($value)) {
            $value = [];
        }
        foreach ($value as $key => $value) {
            $element = $this->getElement($key);
            if (!$element) {
                $this->setElement($key, ['value' => $value]);
            } else {
                $element->setValue($value);
            }
        }

        return $this;
    }
287619
public function setError($error, $key=null)
	{
		if ($key !== null)
		{
			$this->_errors[$key] = $error;
		}
		else
		{
			array_push($this->_errors, $error);
		}
		return $this;
	}
1293328
public function setError($error)
    {
        if (isset($error) && !$error instanceof \Error && !$error instanceof \Exception) {
            $type = (is_object($error) ? get_class($error) . ' ' : '') . gettype($error);
            trigger_error("Excpeted an Error or Exception, got a $type", E_USER_WARNING);
            return;
        }
        
        $this->error = $error;
    }