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