skip to Main Content

Message: Using $this when not in object context codeigniter 3 – PHP

I want to access my database models from database.php file. ` //$ci =& get_instance(); $this->CI->session->userdata('user_id'); $this->CI->load->model('users/user_model'); $current_user = $this->CI->user_model->find($this->CI->auth->user_id()); echo $current_user->organisation; $this->CI->load->model('organisation/organisation_model'); $org = $this->CI->organisation_model->find($current_user->organisation); `

VIEW QUESTION

type '(dynamic) => ProductModel' is not a subtype of type '(String, dynamic) => MapEntry<dynamic, dynamic>' of 'transform' – Flutter

Tried almost every solution. No luck :( Future<List<ProductModel>> getProducts() async { try { final response = await apiService.sendRequest.get('/product'); if (response.data != null) { print("Data == $response"); return response.data .map((e) => ProductModel.fromJson(e.toMap())) // error is thrown here .toList(); } return <ProductModel>[];…

VIEW QUESTION
Back To Top
Search