This content may be out-of-date

This book was written circa 2022, when Joomla 4 was still a new thing. It has not been updated for Joomla 5 and beyond, and it's no longer being worked on. You can usually find more up-to-date information in the official Joomla! Manual.

Customising the validation

One of the many jobs of a Table object is to validate the data before it's written to the database. This is done in its check() method.

You can override that method in your custom Table classes to add custom validation. At the very least you should validate the data type and that the data is within an accepted range of values. The latter is domain-specific, i.e. you need to know how your database table and component work to write that code. That's why Joomla doesn't offer much in the way of automatic data validation.