mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
d4fc08b206
commit
341bb7ede1
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user