Jump to content
a17000

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

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,

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More