Update 09_Validation.md

I believe that ValidationResult's error method is called, addError - and not error as stated in this file.
This commit is contained in:
Simon Winter 2018-02-14 11:48:07 +13:00 committed by GitHub
parent d4fc08b206
commit 341bb7ede1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ class MyObject extends DataObject
$result = parent::validate(); $result = parent::validate();
if($this->Country == 'DE' && $this->Postcode && strlen($this->Postcode) != 5) { if($this->Country == 'DE' && $this->Postcode && strlen($this->Postcode) != 5) {
$result->error('Need five digits for German postcodes'); $result->addError('Need five digits for German postcodes');
} }
return $result; return $result;