Function setErrorResponseIsNull
Trả về null nếu có lỗi request

@author: 713uk13m <dev@nguyenanhung.com>
@time  : 10/7/18 23:04

@param bool $errorResponseIsNull TRUE if Response is Null if Error

@return mixed|$this
339592
public function setErrorResponseIsNull($errorResponseIsNull = FALSE)
    {
        $this->errorResponseIsNull = $errorResponseIsNull;
        $this->debug->info(__FUNCTION__, 'setErrorResponseIsNull: ', $this->errorResponseIsNull);

        return $this;
    }
261361
public function validateNotNULL($msg = null)
    {
        $this->setMandatory();
        if ($msg && $msg !== true) {
            $msg = $this->app->_($msg);
        } else {
            $msg = sprintf($this->app->_('%s is a mandatory field'), $this->caption);
        }
        $this->validateField(array($this, '_validateNotNull'), $msg);

        return $this;
    }
802469
public function setLevel($errorLevel) {

		if(is_null($errorLevel)) {
			$this->errorLevel = error_reporting();
		}
		else {
			$this->errorLevel = $errorLevel;
		}
		
		return $this;

	}
304295
public function allowCredentials($bool = true)
    {
        $this->response = $this->corsHandler->setResponse($this->response)
            ->allowCredentials($bool)
            ->getResponse();

        return $this;
    }
684511
protected function setErrors($response)
    {
        libxml_use_internal_errors(true);

        $doc = new \DOMDocument('1.0', 'utf-8');
        $doc->loadXML($response);

        $errors = libxml_get_errors();
        if (!empty($errors)) {
            $this->errors[] = 'Xml response is invalid';
        }

        return $this;
    }
1043940
public static function setErrorHandler($errorHandler)
    {
        # Get the current error handler to make sure it's set,
        # since it will need to be used if the passed error
        # handler is invalid
        $currentErrorHandler = static::getErrorHandler();
        
        if (!($errorHandler instanceof ErrorHandlerInterface)) {
            $message = 'The error handler argument is not valid, because it doesn\'t implement '
                .ErrorHandlerInterface::class.'.';
                $code = ErrorHandlerInterface::INVALID_ARGUMENT;
            $currentErrorHandler->throwException($message, $code);
        } // @codeCoverageIgnore
        self::$errorHandler = $errorHandler;
    }
1202230
function setErrorResponse($errorNo, $errorDesc) {
    $resultText  = "<CardinalMPI>";
    $resultText = $resultText."<ErrorNo>".($errorNo)."</ErrorNo>" ;
    $resultText = $resultText."<ErrorDesc>".($errorDesc)."</ErrorDesc>" ;
    $resultText  = $resultText."</CardinalMPI>";
    return $resultText;
  }
177771
public function setError($errorName, $errorNameIndex = null, $message = null) {

		if(is_null($errorNameIndex)) {
			$this->formErrors[$errorName] = new FormError($message);
		}
		else {
			$this->formErrors[$errorName][$errorNameIndex] = new FormError($message);
		}

		return $this;

	}
1036455
function setError( $connection = false )
    {
        if ( $this->IsConnected )
        {
            if ( $connection === false )
                $connection = $this->DBConnection;

            if ( $connection instanceof MySQLi )
            {
                $this->ErrorMessage = mysqli_error( $connection );
                $this->ErrorNumber = mysqli_errno( $connection );
            }
        }
        else
        {
            $this->ErrorMessage = mysqli_connect_error();
            $this->ErrorNumber = mysqli_connect_errno();
        }
    }
671404
public function setError($error)
    {
        $this->ocorrenciaTipo = self::OCORRENCIA_ERRO;
        $this->error          = $error;

        return $this;
    }
556449
private function setErrorFromResponse(Response $response)
    {
        $this->statusCode = $response->getStatus();
        $body = $response->getBody();
        if (isset($body['ErrorInfo'])) {
            $this->errorInfo = $body['ErrorInfo'];
        }
        if (isset($body['ErrorMessage'])) {
            $this->errorMessage = $body['ErrorMessage'];
        }
        if (isset($body['ErrorIdentifier'])) {
            $this->errorIdentifier = $body['ErrorIdentifier'];
        }
    }
41376
function rule_neq($val, $error) {
        $this->element->addRule('neq', $error, $val, \HTML_QuickForm2_Rule::ONBLUR_CLIENT_SERVER);
        return $this;
    }
691185
public function setBoolean($boolean = null)
    {
        $this->boolean = null !== $boolean ? (bool) $boolean : null;

        return $this;
    }
570695
protected function _setValidationErrors($errorList)
    {
        if (!is_null($errorList)) {
            $errorList = $this->_normalizeIterable($errorList);
        }

        $this->validationErrors = $errorList;
    }
1063992
public function setError($error)
    {
        if (!$error instanceof \Throwable && !$error instanceof \Exception) {
            throw new InvalidArgumentException(sprintf('The error passed to ConsoleErrorEvent must be an instance of \Throwable or \Exception, "%s" was passed instead.', is_object($error) ? get_class($error) : gettype($error)));
        }

        $this->error = $error;
    }
640336
private function createInvalidInputResponse(ConstraintViolationListInterface $errors): JsonResponse
    {
        $errorMessages = [];
        foreach ($errors as $error) {
            $errorMessages[] = $error->getMessage();
        }

        return $this->createGenericErrorResponse(implode(', ', $errorMessages));
    }
187906
public function setError($error) 
    {
        if (!$this->_isNumericArray($error)) {
            $error =  array ($error);    
        }
        $this->_fields['Error']['FieldValue'] = $error;
        return $this;
    }