CodeIgniter Forums
CI and soapclient class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: CI and soapclient class (/thread-49357.html)



CI and soapclient class - El Forum - 02-16-2012

[eluser]lucid[/eluser]
Hi everyone Smile

I've written a class, which is extension of SoapClient, and it is soo good, that i want to start putting received information (from my methods Wink ) to database, and I want use codeigniter... But I have problem - I have no idae where to "put in a project " my MySoapClientClass"..

I wanted to make it as a 'model', but.. it cannot extends CI_Model, it has to extends SoapClient.. So my idea for workaround..
Can it be like that?:


aplication/libaries/mysoapclass.php
Code:
class MySoapClass extends SoapClient  {
....
}

aplication/models/my_model.php

Code:
class My_Model extends CI_Model {
....
}

aplication/controllers/my_contr.php

Code:
class My_Contr extends CI_Controller {
     public function __construct() {
  parent::__construct();
  $this->load->model('my_model');
  $this->load->library('mysoapclass');
}
      .....
        public class save_data() {
            $data=$this->mysoapclass->receive_some_data();  
            $save=$this->my_model->add_to_db($data);
            ...
        }

}

something like that?