@@ -56,17 +56,14 @@ public function get_course_recordset_where($triggerid) {
5656 global $ DB ;
5757 $ delay = settings_manager::get_settings ($ triggerid , settings_type::TRIGGER )['delay ' ];
5858 $ fieldname = settings_manager::get_settings ($ triggerid , settings_type::TRIGGER )['customfield ' ];
59- if (!($ field = $ DB ->get_record ('customfield_field ' , array ( 'shortname ' => $ fieldname , 'type ' => 'date ' ) ))) {
59+ if (!($ field = $ DB ->get_record ('customfield_field ' , [ 'shortname ' => $ fieldname , 'type ' => 'date ' ] ))) {
6060 throw new \moodle_exception ("missingfield " );
6161 }
6262 $ where = "{course}.id in (select cxt.instanceid from {context} cxt join {customfield_data} d " .
6363 "ON d.contextid = cxt.id AND cxt.contextlevel= " . CONTEXT_COURSE . " " .
6464 "WHERE d.fieldid = :customfieldid AND d.intvalue > 0 AND d.intvalue < :customfielddelay) " ;
65- $ params = array (
66- "customfielddelay " => time () - $ delay ,
67- "customfieldid " => $ field ->id ,
68- );
69- return array ($ where , $ params );
65+ $ params = ["customfielddelay " => time () - $ delay , "customfieldid " => $ field ->id ];
66+ return [$ where , $ params ];
7067 }
7168
7269 /**
@@ -82,10 +79,7 @@ public function get_subpluginname() {
8279 * @return instance_setting[] containing settings keys and PARAM_TYPES
8380 */
8481 public function instance_settings () {
85- return array (
86- new instance_setting ('delay ' , PARAM_INT ),
87- new instance_setting ('customfield ' , PARAM_TEXT ),
88- );
82+ return [new instance_setting ('delay ' , PARAM_INT ), new instance_setting ('customfield ' , PARAM_TEXT )];
8983 }
9084
9185 /**
@@ -98,8 +92,8 @@ public function extend_add_instance_form_definition($mform) {
9892 global $ DB ;
9993 $ mform ->addElement ('duration ' , 'delay ' , get_string ('delay ' , 'lifecycletrigger_customfielddelay ' ));
10094 $ mform ->addHelpButton ('delay ' , 'delay ' , 'lifecycletrigger_customfielddelay ' );
101- $ fields = $ DB ->get_records ('customfield_field ' , array ( 'type ' => 'date ' ) );
102- $ choices = array () ;
95+ $ fields = $ DB ->get_records ('customfield_field ' , [ 'type ' => 'date ' ] );
96+ $ choices = [] ;
10397 foreach ($ fields as $ field ) {
10498 $ choices [$ field ->shortname ] = $ field ->name ;
10599 }
0 commit comments