Validation Database Group Definition |
Hi,
On my Ci4 app I have split my customers tables (prefixed per customer) accross a number of databases and therefore have a number of defined database groups. I control access to the correct database and correct table prefix via session values, populated at login. I am also using the config\validation.php for my validation rules. However, one of my validation rules checks the database to validate the data is winthin the defined bounds. PHP Code: public $Division = [
Try to add 'DBGroup' key and its value in the data to validate.
Try to use `Validation::run()` method with the third param DBGroup. PHP Code: run(?array $data = null, ?string $group = null, ?string $dbGroup = null)
(01-20-2022, 06:44 PM)kenjis Wrote: Try to add 'DBGroup' key and its value in the data to validate. Many thanks, I'll have a play with this as I also need to add the table prefix somewhere along the line. This is very helpful. Cheers, Martin |
Welcome Guest, Not a member yet? Register Sign In |