CakePHP 4 - Saving multiple levels of associated data

preview_player
Показать описание
00:45 Create a migration from sample post data
06:39 Bake the Devices, Modules, Ports MVC
08:00 Add saveAssociated Controller action and creating entities from an array
10:19 Adding the options array to save associated data
12:49 Example of too much array nesting causing options to be ignored
13:54 Wasting time looking for 'accessibleFields' option in documentation
15:25 Using 'accessibleFields' to Changing Accessible Fields at run time
17:49 Trigger validation and viewing error array
18:07 Saving additional data to the join table. Array method
21:20 Adding _joinData using the Entity method
24:30 Linking existing data using _ids

Рекомендации по теме
Комментарии
Автор

Awesome video! Now how would you build a UI which returns that respective nested array data as request data? Like mixing creating new entities with field data as well as updating already present (and linked) entity fields. The FormHelper in cake is nice to get started but it definitely doesn't catch all the dynamic field usecases.

KevinPfeifer