Using Injector pattern for ValidationResult in Member

This commit is contained in:
Will Morgan 2013-06-18 15:49:58 +01:00
parent 9a95db1998
commit db3eed1f9a

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