@@ -773,7 +773,7 @@ public function user_delete_response(
773773 !in_array ($ result ->waitinglist , [MOD_BOOKING_STATUSPARAM_DELETED , MOD_BOOKING_STATUSPARAM_PREVIOUSLYBOOKED ])
774774 ) {
775775 $ result ->waitinglist = MOD_BOOKING_STATUSPARAM_DELETED ;
776- $ result ->timemodified = time ();
776+ $ result ->timemodified = \ core \di:: get (\ core \clock::class)-> time ();
777777 $ result ->openruleexecution = $ openruleexecution ? time () : 0 ;
778778 // We mark all the booking answers as deleted.
779779 $ DB ->update_record ('booking_answers ' , $ result );
@@ -1524,7 +1524,7 @@ public static function write_user_answer_to_db(
15241524 ) {
15251525
15261526 global $ DB , $ USER ;
1527- $ now = time ();
1527+ $ now = \ core \di:: get (\ core \clock::class)-> time ();
15281528
15291529 // For book with credits, we need to delete the cache.
15301530 $ settings = singleton_service::get_instance_of_booking_option_settings ($ optionid );
@@ -1565,7 +1565,7 @@ public static function write_user_answer_to_db(
15651565 !empty ($ settings ->selflearningcourse )
15661566 && empty ($ currentanswerid ) // We don't override on checkout.
15671567 ) {
1568- $ now = time ();
1568+ $ now = \ core \di:: get (\ core \clock::class)-> time ();
15691569 $ duration = $ settings ->duration ?? 0 ;
15701570 $ end = empty ($ duration ) ? 0 : $ now + $ duration ;
15711571 self ::add_data_to_json ($ newanswer , 'selflearningendofsubscription ' , $ end );
@@ -1601,18 +1601,18 @@ public static function write_user_answer_to_db(
16011601 $ tm = self ::get_data_from_json ($ answer , 'confirmwaitinglist_timemodified ' );
16021602 if (is_array ($ tm )) { // If it is an array, we just add new time to it.
16031603 $ timemodified = $ tm ;
1604- $ timemodified [] = time ();
1604+ $ timemodified [] = \ core \di:: get (\ core \clock::class)-> time ();
16051605 } else if (is_numeric ($ tm )) { // If it is a number we chnaged it to array of number and then we add new value.
16061606 $ timemodified = [(int ) $ tm ];
1607- $ timemodified [] = time ();
1607+ $ timemodified [] = \ core \di:: get (\ core \clock::class)-> time ();
16081608 } else {
16091609 $ timemodified = [];
1610- $ timemodified [] = time ();
1610+ $ timemodified [] = \ core \di:: get (\ core \clock::class)-> time ();
16111611 }
16121612 } else {
16131613 $ confirmationcount = 1 ;
16141614 $ modifieduserid [] = $ USER ->id ;
1615- $ timemodified [] = time ();
1615+ $ timemodified [] = \ core \di:: get (\ core \clock::class)-> time ();
16161616 }
16171617
16181618 // The confirmation on the waitinglist is saved here.
@@ -1717,7 +1717,7 @@ public function user_confirm_response(stdClass $user): bool {
17171717 );
17181718 } else {
17191719 // When it's the first reserveration, we just confirm it.
1720- $ currentanswer ->timemodified = time ();
1720+ $ currentanswer ->timemodified = \ core \di:: get (\ core \clock::class)-> time ();
17211721 $ currentanswer ->waitinglist = MOD_BOOKING_STATUSPARAM_BOOKED ;
17221722
17231723 self ::write_user_answer_to_db (
@@ -2039,7 +2039,7 @@ public function enrol_user(
20392039 // Timecreated is not a perfect solution, because users could have been on the waitinglist.
20402040 $ now = $ ba ->timecreated ;
20412041 } else {
2042- $ now = time ();
2042+ $ now = \ core \di:: get (\ core \clock::class)-> time ();
20432043 }
20442044
20452045 $ duration = $ this ->settings ->duration ?? 0 ;
@@ -3026,7 +3026,7 @@ public function confirmactivity(?int $userid = null) {
30263026 ['optionid ' => $ this ->optionid , 'userid ' => $ userid , 'waitinglist ' => MOD_BOOKING_STATUSPARAM_BOOKED ]
30273027 );
30283028 $ userdata ->completed = '1 ' ;
3029- $ userdata ->timemodified = time ();
3029+ $ userdata ->timemodified = \ core \di:: get (\ core \clock::class)-> time ();
30303030
30313031 $ DB ->update_record ('booking_answers ' , $ userdata );
30323032
@@ -3599,7 +3599,7 @@ public function show_conference_link(?int $sessionid = null): bool {
35993599 return false ;
36003600 }
36013601
3602- $ now = time ();
3602+ $ now = \ core \di:: get (\ core \clock::class)-> time ();
36033603 $ openingtime = strtotime ("+15 minutes " , $ now );
36043604
36053605 if (!$ sessionid ) {
@@ -3725,7 +3725,7 @@ public static function cancelbookingoption(
37253725
37263726 $ settings = singleton_service::get_instance_of_booking_option_settings ($ optionid );
37273727
3728- $ now = time ();
3728+ $ now = \ core \di:: get (\ core \clock::class)-> time ();
37293729
37303730 $ record = $ DB ->get_record ('booking_options ' , ['id ' => $ optionid ]);
37313731
@@ -3782,7 +3782,7 @@ public static function cancelbookingoption(
37823782 public static function get_consumed_quota (int $ optionid ) {
37833783
37843784 $ optionsettings = singleton_service::get_instance_of_booking_option_settings ($ optionid );
3785- $ now = time ();
3785+ $ now = \ core \di:: get (\ core \clock::class)-> time ();
37863786 $ consumedquota = 0.0 ;
37873787
37883788 if (empty ($ optionsettings ->sessions )) {
0 commit comments