to_group = $form_model->getItem('to_group'); $model->bot_id = $form_model->getItem('bot_id'); $model->dialog_id = $form_model->getItem('dialog_id'); $model->content = $form_model->getItem('content'); $model->photo = $form_model->getItem('username'); $model->status = $form_model->getItem('status'); if ($model->save()){ return $model; } return false; } public function update(FormModel $form_model, TgbotNotification $model): false|TgbotNotification { $model->bot_id = $form_model->getItem('bot_id'); $model->dialog_id = $form_model->getItem('dialog_id'); $model->to_group = $form_model->getItem('to_group'); $model->content = $form_model->getItem('content'); $model->photo = $form_model->getItem('photo'); $model->status = $form_model->getItem('status'); if ($model->save()){ return $model; } return false; } }