mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Using Injector pattern for ValidationResult in Member
This commit is contained in:
parent
9a95db1998
commit
db3eed1f9a
@ -230,7 +230,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
||||
* @return ValidationResult
|
||||
*/
|
||||
public function canLogIn() {
|
||||
$result = new ValidationResult();
|
||||
$result = ValidationResult::create();
|
||||
|
||||
if($this->isLockedOut()) {
|
||||
$result->error(_t (
|
||||
@ -677,7 +677,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
||||
)
|
||||
);
|
||||
if($existingRecord) {
|
||||
throw new ValidationException(new ValidationResult(false, _t(
|
||||
throw new ValidationException(ValidationResult::create(false, _t(
|
||||
'Member.ValidationIdentifierFailed',
|
||||
'Can\'t overwrite existing member #{id} with identical identifier ({name} = {value}))',
|
||||
'Values in brackets show "fieldname = value", usually denoting an existing email address',
|
||||
|
Loading…
Reference in New Issue
Block a user