public function getError()
    {
        $error = new Error($this->getMessage());
        $error->setValue($this->value);
        if ($this->field !== null) {
            $error->setName($this->field->getName());
        }
        if ($this->valueIndex !== null) {
            $error->setIndex($this->valueIndex);
        }
        return $error;
    }
public function getError()
    {
        $error = new Error($this->getMessage());
        $error->setValue($this->value);
        if ($this->field !== null) {
            $error->setName($this->field->getName());
        }
        if ($this->valueIndex !== null) {
            $error->setIndex($this->valueIndex);
        }
        return $error;
    }
public function getError ( ) { $ error = new Error ( $ this -> getMessage ( ) ) ; $ error -> setValue ( $ this -> value ) ; if ( $ this -> field !== null ) { $ error -> setName ( $ this -> field -> getName ( ) ) ; } if ( $ this -> valueIndex !== null ) { $ error -> setIndex ( $ this -> valueIndex ) ; } return $ error ; }
Get an error instance

@return sndsgd\field\Error
Get an error instance