title = $form_model->getItem('title'); $model->content = $form_model->getItem('content'); $model->additional_information = $form_model->getItem('additional_information'); $model->link = $form_model->getItem('link'); if ($model->save()){ return $model; } return false; } public function update(FormModel $form_model, Slider $slider): false|Slider { $slider->title = $form_model->getItem('title'); $slider->content = $form_model->getItem('content'); $slider->additional_information = $form_model->getItem('additional_information'); $slider->link = $form_model->getItem('link'); if ($slider->save()){ return $slider; } return false; } }