Json serialized data in cakephp

Is it possible to use JSON-serialized data in cakephp database? The idea is to use cakephp “normally” but save the data in db maybe only with id and data columns (users can edit data structure). How should I design this to use standard cakephp functionality (e.g. validation)? I could not find the answer in the book.

Cakephp 2 and 4 versions.

No easy way of doing it in CakePHP 2, but in v3 and 4 you can use a combination of https://book.cakephp.org/4/en/orm/saving-data.html#saving-complex-types and https://book.cakephp.org/4/en/core-libraries/validation.html#nesting-validators

1 Like