model = new TgbotNotification(); } #[NoReturn] public function actionGetToSend(): void { $notification = TgbotNotification::where("status", TgbotNotification::TO_SEND_STATUS)->first(); if ($notification){ $notification->status = TgbotNotification::SENT_STATUS; $notification->save(); $this->renderApi($notification->toArray()); } $this->renderApi([]); } }