3636 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3737 */
3838class backup_ratingallocate_activity_structure_step extends backup_activity_structure_step {
39-
4039 /**
4140 * Define the complete ratingallocate structure for backup.
4241 * @return backup_nested_element
@@ -51,41 +50,59 @@ protected function define_structure() {
5150
5251 // Define each element separated.
5352 $ class = 'mod_ratingallocate\db\ratingallocate ' ;
54- $ ratingallocate = new backup_nested_element (get_tablename_for_tableClass ($ class ), get_id_for_tableClass ($ class ),
55- get_fields_for_tableClass ($ class ));
53+ $ ratingallocate = new backup_nested_element (
54+ get_tablename_for_tableClass ($ class ),
55+ get_id_for_tableClass ($ class ),
56+ get_fields_for_tableClass ($ class )
57+ );
5658
5759 $ class = 'mod_ratingallocate\db\ratingallocate_choices ' ;
5860 $ ratingallocatechoices = new backup_nested_element (get_tablename_for_tableClass ($ class ) . 's ' );
59- $ ratingallocatechoice = new backup_nested_element (get_tablename_for_tableClass ($ class ), get_id_for_tableClass ($ class ),
60- get_fields_for_tableClass ($ class ));
61+ $ ratingallocatechoice = new backup_nested_element (
62+ get_tablename_for_tableClass ($ class ),
63+ get_id_for_tableClass ($ class ),
64+ get_fields_for_tableClass ($ class )
65+ );
6166
6267 $ class = 'mod_ratingallocate\db\ratingallocate_ratings ' ;
6368 $ ratingallocateratings = new backup_nested_element (get_tablename_for_tableClass ($ class ) . 's ' );
64- $ ratingallocaterating = new backup_nested_element (get_tablename_for_tableClass ($ class ), get_id_for_tableClass ($ class ),
65- get_fields_for_tableClass ($ class ));
69+ $ ratingallocaterating = new backup_nested_element (
70+ get_tablename_for_tableClass ($ class ),
71+ get_id_for_tableClass ($ class ),
72+ get_fields_for_tableClass ($ class )
73+ );
6674
6775 $ class = 'mod_ratingallocate\db\ratingallocate_allocations ' ;
6876 $ ratingallocateallocations = new backup_nested_element (get_tablename_for_tableClass ($ class ) . 's ' );
69- $ ratingallocateallocation = new backup_nested_element (get_tablename_for_tableClass ($ class ), get_id_for_tableClass ($ class ),
70- get_fields_for_tableClass ($ class ));
77+ $ ratingallocateallocation = new backup_nested_element (
78+ get_tablename_for_tableClass ($ class ),
79+ get_id_for_tableClass ($ class ),
80+ get_fields_for_tableClass ($ class )
81+ );
7182
7283 $ groupchoiceclass = 'mod_ratingallocate\db\ratingallocate_group_choices ' ;
7384 $ groupchoices = new backup_nested_element (get_tablename_for_tableClass ($ groupchoiceclass ) . 's ' );
74- $ groupchoice = new backup_nested_element (get_tablename_for_tableClass ($ groupchoiceclass ),
85+ $ groupchoice = new backup_nested_element (
86+ get_tablename_for_tableClass ($ groupchoiceclass ),
7587 get_id_for_tableClass ($ groupchoiceclass ),
76- get_fields_for_tableClass ($ groupchoiceclass ));
88+ get_fields_for_tableClass ($ groupchoiceclass )
89+ );
7790
7891 $ choicegroupclass = 'mod_ratingallocate\db\ratingallocate_ch_gengroups ' ;
7992 $ ratingallocatechoicegroups = new backup_nested_element (get_tablename_for_tableClass ($ choicegroupclass ) . 's ' );
80- $ ratingallocatechoicegroup = new backup_nested_element (get_tablename_for_tableClass ($ choicegroupclass ),
81- get_id_for_tableClass ($ choicegroupclass ),
82- get_fields_for_tableClass ($ choicegroupclass ));
93+ $ ratingallocatechoicegroup = new backup_nested_element (
94+ get_tablename_for_tableClass ($ choicegroupclass ),
95+ get_id_for_tableClass ($ choicegroupclass ),
96+ get_fields_for_tableClass ($ choicegroupclass )
97+ );
8398
8499 $ groupingclass = 'mod_ratingallocate\db\ratingallocate_groupings ' ;
85100 $ ratingallocategroupings = new backup_nested_element (get_tablename_for_tableClass ($ groupingclass ) . 's ' );
86- $ ratingallocategrouping = new backup_nested_element (get_tablename_for_tableClass ($ groupingclass ),
87- get_id_for_tableClass ($ groupingclass ),
88- get_fields_for_tableClass ($ groupingclass ));
101+ $ ratingallocategrouping = new backup_nested_element (
102+ get_tablename_for_tableClass ($ groupingclass ),
103+ get_id_for_tableClass ($ groupingclass ),
104+ get_fields_for_tableClass ($ groupingclass )
105+ );
89106
90107 // Build the tree.
91108 $ ratingallocate ->add_child ($ ratingallocatechoices );
@@ -107,29 +124,41 @@ protected function define_structure() {
107124 $ ratingallocatechoicegroups ->add_child ($ ratingallocatechoicegroup );
108125
109126 // Define sources.
110- $ ratingallocate ->set_source_table (get_tablename_for_tableClass ('mod_ratingallocate\db\ratingallocate ' ),
111- [this_db \ratingallocate::ID => backup::VAR_ACTIVITYID ], this_db \ratingallocate_choices::ID . ' ASC ' );
112- $ ratingallocatechoice ->set_source_table (get_tablename_for_tableClass ('mod_ratingallocate\db\ratingallocate_choices ' ),
113- [this_db \ratingallocate_choices::RATINGALLOCATEID => backup::VAR_PARENTID ],
114- this_db \ratingallocate_choices::ID . ' ASC ' );
127+ $ ratingallocate ->set_source_table (
128+ get_tablename_for_tableClass ('mod_ratingallocate\db\ratingallocate ' ),
129+ [this_db \ratingallocate::ID => backup::VAR_ACTIVITYID ],
130+ this_db \ratingallocate_choices::ID . ' ASC '
131+ );
132+ $ ratingallocatechoice ->set_source_table (
133+ get_tablename_for_tableClass ('mod_ratingallocate\db\ratingallocate_choices ' ),
134+ [this_db \ratingallocate_choices::RATINGALLOCATEID => backup::VAR_PARENTID ],
135+ this_db \ratingallocate_choices::ID . ' ASC '
136+ );
115137 $ groupchoice ->set_source_table (get_tablename_for_tableClass ($ groupchoiceclass ), ['choiceid ' => backup::VAR_PARENTID ]);
116138 $ ratingallocatechoicegroup ->set_source_table (
117- get_tablename_for_tableClass ($ choicegroupclass ), ['choiceid ' => backup::VAR_PARENTID ]);
139+ get_tablename_for_tableClass ($ choicegroupclass ),
140+ ['choiceid ' => backup::VAR_PARENTID ]
141+ );
118142 $ ratingallocategrouping ->set_source_table (
119- get_tablename_for_tableClass ($ groupingclass ), ['ratingallocateid ' => backup::VAR_PARENTID ]);
143+ get_tablename_for_tableClass ($ groupingclass ),
144+ ['ratingallocateid ' => backup::VAR_PARENTID ]
145+ );
120146
121147 if ($ userinfo ) {
122- $ ratingallocaterating ->set_source_table (get_tablename_for_tableClass (
123- 'mod_ratingallocate\db\ratingallocate_ratings ' ),
124- [this_db \ratingallocate_ratings::CHOICEID => backup::VAR_PARENTID ],
125- this_db \ratingallocate_ratings::ID . ' ASC ' );
148+ $ ratingallocaterating ->set_source_table (
149+ get_tablename_for_tableClass (
150+ 'mod_ratingallocate\db\ratingallocate_ratings '
151+ ),
152+ [this_db \ratingallocate_ratings::CHOICEID => backup::VAR_PARENTID ],
153+ this_db \ratingallocate_ratings::ID . ' ASC '
154+ );
126155 $ ratingallocateallocation ->set_source_table (
127- get_tablename_for_tableClass ('mod_ratingallocate\db\ratingallocate_allocations ' ),
128- [
156+ get_tablename_for_tableClass ('mod_ratingallocate\db\ratingallocate_allocations ' ),
157+ [
129158 this_db \ratingallocate_allocations::RATINGALLOCATEID => backup::VAR_ACTIVITYID ,
130159 this_db \ratingallocate_allocations::CHOICEID => backup::VAR_PARENTID ,
131160 ],
132- this_db \ratingallocate_allocations::ID . ' ASC '
161+ this_db \ratingallocate_allocations::ID . ' ASC '
133162 );
134163 }
135164
0 commit comments