public function validateModelObject(ModelObject $model)
    {
        $fields = $model->getPersistentFields();

        foreach ( $fields as $fieldName ) {

            $value         = $model->$fieldName;
            $fieldResolved = get_class($model).'.'.$fieldName;

            $this->rejectIfInvalid($fieldResolved,
                                   'field',
                                   $model->getFieldTitle($fieldName),
                                   $value,
                                   new ValidationExpression($model->getValidation($fieldName)));
        }
    }
public function validateModelObject(ModelObject $model)
    {
        $fields = $model->getPersistentFields();

        foreach ( $fields as $fieldName ) {

            $value         = $model->$fieldName;
            $fieldResolved = get_class($model).'.'.$fieldName;

            $this->rejectIfInvalid($fieldResolved,
                                   'field',
                                   $model->getFieldTitle($fieldName),
                                   $value,
                                   new ValidationExpression($model->getValidation($fieldName)));
        }
    }
public function validateModelObject ( ModelObject $ model ) { $ fields = $ model -> getPersistentFields ( ) ; foreach ( $ fields as $ fieldName ) { $ value = $ model -> $ fieldName ; $ fieldResolved = get_class ( $ model ) . '.' . $ fieldName ; $ this -> rejectIfInvalid ( $ fieldResolved , 'field' , $ model -> getFieldTitle ( $ fieldName ) , $ value , new ValidationExpression ( $ model -> getValidation ( $ fieldName ) ) ) ; } }
Validates the model object, rejecting the fields that fail validation

@param ModelObject $model The object to validate

@return void
Validates the model object rejecting the fields that fail validation