Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ValidationInterface to the DataObject class #11457

Open
2 tasks
emteknetnz opened this issue Nov 6, 2024 · 0 comments
Open
2 tasks

Add ValidationInterface to the DataObject class #11457

emteknetnz opened this issue Nov 6, 2024 · 0 comments

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Nov 6, 2024

https://github.com/silverstripe/silverstripe-framework/blob/6/src/Core/Validation/ValidationInterface.php provides a standardised method signature for objects with a validate() method

So far this had been added to

  • DBField
  • FormField
  • FieldValidator (via the subclass FieldValidationInterface)

At very least it should be added to DataObject which already effectively implements it, just with loose typing.

If feasible within a reasonable amount of it, it should also be added to as many other objects that currently have a validate($validator) or validate(): bool, which will involve some level of refactoring

Acceptance criteria

  • ValidationInterface is added to DataObject, either directly or by getting DataObjectInterface to extend ValidationInterface
  • Any other validate() methods that can be easily refactored also implement ValidationInterface
@emteknetnz emteknetnz added this to the Silverstripe CMS 6.0 milestone Nov 6, 2024
@GuySartorelli GuySartorelli changed the title Add ValidationInterface to objects Add ValidationInterface to the DataObject class Nov 6, 2024
@emteknetnz emteknetnz self-assigned this Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant