public function validateInput()
    {
        $this->errorFields = array();
        foreach ($this->bizRecord->inputFields as $fld) {

            /* @var $bizField BizField */
            $bizField = $this->bizRecord->get($fld);
            if ($bizField->encrypted == "Y") {
                if ($bizField->checkRequired() == true &&
                        ($bizField->value === null || $bizField->value === "")) {
                    $this->errorMessage = $this->getMessage("DATA_FIELD_REQUIRED", array($fld));
                    $this->errorFields[$bizField->objectName] = $this->errorMessage;
                }
                continue;
            }
            if ($bizField->checkRequired() == true &&
                    ($bizField->value === null || $bizField->value === "")) {
                $this->errorMessage = $this->getMessage("DATA_FIELD_REQUIRED", array($fld));
                $this->errorFields[$bizField->objectName] = $this->errorMessage;
            } elseif ($bizField->value !== null && $bizField->checkValueType() == false) {
                $this->errorMessage = $this->getMessage("DATA_FIELD_INCORRECT_TYPE", array($fld, $bizField->type));
                $this->errorFields[$bizField->objectName] = $this->errorMessage;
            } elseif ($bizField->value !== null && $bizField->Validate() == false) {

                /* @var $validateService validateService */
                $validateService = Openbizx::getService(VALIDATE_SERVICE);
                $this->errorMessage = $validateService->getErrorMessage($bizField->validator, $bizField->objectName);
                if ($this->errorMessage == false) { //Couldn't get a clear error message so let's try this
                    $this->errorMessage = $this->getMessage("DATA_FIELD_INVALID_INPUT", array($fld, $value, $bizField->validator));                //
                }
                $this->errorFields[$bizField->objectName] = $this->errorMessage;
            }
        }
        if (count($this->errorFields) > 0) {
            //print_r($this->errorFields);
            throw new Openbizx\Validation\Exception($this->errorFields);
            //return false;
        }

        // validate uniqueness
        if ($this->validateUniqueness() == false) {
            return false;
        }

        return true;
    }
public function validateInput()
    {
        $this->errorFields = array();
        foreach ($this->bizRecord->inputFields as $fld) {

            /* @var $bizField BizField */
            $bizField = $this->bizRecord->get($fld);
            if ($bizField->encrypted == "Y") {
                if ($bizField->checkRequired() == true &&
                        ($bizField->value === null || $bizField->value === "")) {
                    $this->errorMessage = $this->getMessage("DATA_FIELD_REQUIRED", array($fld));
                    $this->errorFields[$bizField->objectName] = $this->errorMessage;
                }
                continue;
            }
            if ($bizField->checkRequired() == true &&
                    ($bizField->value === null || $bizField->value === "")) {
                $this->errorMessage = $this->getMessage("DATA_FIELD_REQUIRED", array($fld));
                $this->errorFields[$bizField->objectName] = $this->errorMessage;
            } elseif ($bizField->value !== null && $bizField->checkValueType() == false) {
                $this->errorMessage = $this->getMessage("DATA_FIELD_INCORRECT_TYPE", array($fld, $bizField->type));
                $this->errorFields[$bizField->objectName] = $this->errorMessage;
            } elseif ($bizField->value !== null && $bizField->Validate() == false) {

                /* @var $validateService validateService */
                $validateService = Openbizx::getService(VALIDATE_SERVICE);
                $this->errorMessage = $validateService->getErrorMessage($bizField->validator, $bizField->objectName);
                if ($this->errorMessage == false) { //Couldn't get a clear error message so let's try this
                    $this->errorMessage = $this->getMessage("DATA_FIELD_INVALID_INPUT", array($fld, $value, $bizField->validator));                //
                }
                $this->errorFields[$bizField->objectName] = $this->errorMessage;
            }
        }
        if (count($this->errorFields) > 0) {
            //print_r($this->errorFields);
            throw new Openbizx\Validation\Exception($this->errorFields);
            //return false;
        }

        // validate uniqueness
        if ($this->validateUniqueness() == false) {
            return false;
        }

        return true;
    }
public function validateInput ( ) { $ this -> errorFields = array ( ) ; foreach ( $ this -> bizRecord -> inputFields as $ fld ) { /* @var $bizField BizField */ $ bizField = $ this -> bizRecord -> get ( $ fld ) ; if ( $ bizField -> encrypted == "Y" ) { if ( $ bizField -> checkRequired ( ) == true && ( $ bizField -> value === null || $ bizField -> value === "" ) ) { $ this -> errorMessage = $ this -> getMessage ( "DATA_FIELD_REQUIRED" , array ( $ fld ) ) ; $ this -> errorFields [ $ bizField -> objectName ] = $ this -> errorMessage ; } continue ; } if ( $ bizField -> checkRequired ( ) == true && ( $ bizField -> value === null || $ bizField -> value === "" ) ) { $ this -> errorMessage = $ this -> getMessage ( "DATA_FIELD_REQUIRED" , array ( $ fld ) ) ; $ this -> errorFields [ $ bizField -> objectName ] = $ this -> errorMessage ; } elseif ( $ bizField -> value !== null && $ bizField -> checkValueType ( ) == false ) { $ this -> errorMessage = $ this -> getMessage ( "DATA_FIELD_INCORRECT_TYPE" , array ( $ fld , $ bizField -> type ) ) ; $ this -> errorFields [ $ bizField -> objectName ] = $ this -> errorMessage ; } elseif ( $ bizField -> value !== null && $ bizField -> Validate ( ) == false ) { /* @var $validateService validateService */ $ validateService = Openbizx :: getService ( VALIDATE_SERVICE ) ; $ this -> errorMessage = $ validateService -> getErrorMessage ( $ bizField -> validator , $ bizField -> objectName ) ; if ( $ this -> errorMessage == false ) { //Couldn't get a clear error message so let's try this $ this -> errorMessage = $ this -> getMessage ( "DATA_FIELD_INVALID_INPUT" , array ( $ fld , $ value , $ bizField -> validator ) ) ; // } $ this -> errorFields [ $ bizField -> objectName ] = $ this -> errorMessage ; } } if ( count ( $ this -> errorFields ) > 0 ) { //print_r($this->errorFields); throw new Openbizx \ Validation \ Exception ( $ this -> errorFields ) ; //return false; } // validate uniqueness if ( $ this -> validateUniqueness ( ) == false ) { return false ; } return true ; }
Validate user input data and trigger error message and adjust BizField if invalid.

@return boolean
@todo: throw Openbizx\Data\Exception
Validate user input data and trigger error message and adjust BizField if invalid .