Jump to content

object->validateFields object->validateFieldsLang get all error, not one by one


a17000

Recommended Posts

Hi,

I want to get all error when I launch validateFields and validateFieldsLang on a object.

Is it possible ?

example :

$product = new Product();
$product->pack_stock_type='ZZZZ';
$product->additional_delivery_times='XXX';
if (($field_error = $product->validateFields(false, true)) === true && ($lang_field_error = $product->validateFieldsLang(false, true)) === true) {
	return true;
} else {
	if ($field_error !== true || isset($lang_field_error) && $lang_field_error !== true) {
                 $errors = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : '').Db::getInstance()->getMsgError();
				$message.=$errors.CRLF_ALEX;//HERE ONE ERROR, I WANT ALL ERROR
				return false;		
             }
}

Thanks,

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...