Merge pull request #2112 from willmorgan/master

MINOR Using Injector pattern for ValidationResult in Member
This commit is contained in:
Ingo Schommer 2013-06-18 09:36:11 -07:00
commit d95f8a87ac

View File

@ -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',